ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 WPViewPDF
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Traymaster

United Kingdom
1 Posts

Posted - Oct 02 2017 :  15:10:50  Show Profile  Reply
Hello, I recently purchased these components and the WPViewPDF controls. Whilst the install of the imageen controls has been super easy and I have begun using them' the WPViewPDF control Just does not seem to want to install and work.

Can anyone provide a guide on how to install this component so it works in the IDE; and a brief on the steps to make it compile and work.

I am using windows 10 pro and xe4?

I hope someone can provide the steps so I can use this?

Thanks
Robert

w2m

USA
1990 Posts

Posted - Oct 02 2017 :  16:47:10  Show Profile  Reply
The plugin will not work at design time. To use the plugin at runtime:

Usage: Add wpcubed_pdf_plugin (wpcubed_pdf_plugin.pas) to your uses clause and call this code:

Then this variables need to be initialized, i.e.

if TIEWPCubedPDF.Initialize then
TIEWPCubedPDF.RegisterPlugin
else ShowMessage('PDF decoder DLL could not be found');

at the end of your main unit please add this code:

{$I PDFLicense.INC}

initialization

glWPViewPDF_DLLName := WPViewPDF_DLLName;
glWPViewPDF_DLLName64 := WPViewPDF_DLLName64;
glWPViewPDF_LicName := WPViewPDF_LicName;
glWPViewPDF_LicKey := WPViewPDF_LicKey;
glWPViewPDF_LicCode := WPViewPDF_LicCode;

(The WPViewPDF DLL name and the license code is defined in the file
PDFLicense.INC)

The plugin (wpcubed_pdf_plugin.pas) and PDFLicense.INC) should be placed in the projects source code folder. The plugin dll's should be located the project's exe folder.

Here is some demo source:
unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
  wpcubed_pdf_plugin, hyieutils, iexBitmaps, hyiedefs, iesettings, iexLayers,
  iexRulers, imageenio, ieview, imageenview, Vcl.StdCtrls, Vcl.ExtDlgs,
  Vcl.ExtCtrls, iemview;

type
  TForm1 = class(TForm)
    Panel1: TPanel;
    OpenPictureDialog1: TOpenPictureDialog;
    Open1: TButton;
    ImageEnView1: TImageEnView;
    Open2: TButton;
    ImageEnMView1: TImageEnMView;
    procedure FormCreate(Sender: TObject);
    procedure Open1Click(Sender: TObject);
    procedure Open2Click(Sender: TObject);
    procedure ImageEnMView1ImageSelect(Sender: TObject; idx: Integer);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
 if TIEWPCubedPDF.Initialize then
    TIEWPCubedPDF.RegisterPlugin
  else
    MessageBox(0, 'PDF decoder DLL could not be found.', 'Error',
      MB_ICONERROR or MB_OK);
  ImageEnMView1.SetModernStyling(False, 140, 125);
end;

procedure TForm1.ImageEnMView1ImageSelect(Sender: TObject; idx: Integer);
begin
  ImageEnMView1.CopyToIEBitmap(idx, ImageEnView1.IEBitmap);
  ImageEnView1.IO.Params.Assign(ImageEnMView1.MIO.Params[idx]);
  ImageEnView1.Update;
end;

procedure TForm1.Open1Click(Sender: TObject);
begin
  if OpenPictureDialog1.Execute then
  begin
    ImageEnView1.IO.LoadFromFile(OpenPictureDialog1.FileName);
  end;
end;

procedure TForm1.Open2Click(Sender: TObject);
begin
  if OpenPictureDialog1.Execute then
  begin
    ImageEnMView1.MIO.LoadFromFile(OpenPictureDialog1.FileName);
  end;
end;

{$I PDFLicense.INC}
initialization

     glWPViewPDF_DLLName   := WPViewPDF_DLLName;
     glWPViewPDF_DLLName64 := WPViewPDF_DLLName64;
     glWPViewPDF_LicName   := WPViewPDF_LicName;
     glWPViewPDF_LicKey    := WPViewPDF_LicKey;
     glWPViewPDF_LicCode   := WPViewPDF_LicCode;

end.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: