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