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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Error with WPCubed plugin

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
VersatileSoftware Posted - Sep 28 2016 : 14:53:15
I purchased the WPViewPDF V4 MakeImage plugin from WPCubed. I'm having issues getting it to work with ImageEn. In the instructions it says to do the following:

1) Add location of wpcubed_pdf_plugin.pas and PDFLicense.inc to the library path in Delphi
2) Add the plugin wpcubed_pdf_plugin to the uses clause in your code.
3) Call the following code:

if not TIEWPCubedPDF.IsAvailable() then
raise Exception.create( 'PDF DLLs not found!' );

When first compiled, it would give the error because the following lines of code were placed before the uses clause.

{$I ie.inc}
{$I PDFLicense.INC}

These lines were moved after the uses clause and it no longer seems to give an issue.

But now I'm getting an error that TIEWPCubedPDF is an "undeclared identifier". I tried loading the WPPDF_Multi demo that was included with the WPCubed plugin and it gives the same error in the OnCreate event at the first line of the following code:

if not TIEWPCubedPDF.IsAvailable() then
raise Exception.create( 'PDF DLLs not found!' );

What are the proper steps to get the WPCubed plugin to work with ImageEn and to display PDF's in the ImageEnView and ImageEnMView components? There doesn't seem to be any instructions on how to do this.

Using: Delphi XE5 (Plan to switch to Delphi Seattle 10 soon), Windows 10 Pro

Thanks,
Ron
13   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - Mar 02 2017 : 16:16:49
Here the preview is shown in the current version. How can this be?

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
xequte Posted - Mar 02 2017 : 14:53:36
Hi

This is probably due to a limitation in 6.3.2. Previews are supported in the current beta we are working on (ready later in March, if all goes to plan).

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
ocuco2017 Posted - Feb 28 2017 : 10:49:48
***Sorry it was mistake in my previous Post, I missed word 'not' ***

*.pdf file is not previewed in preview window of OpenImageEnDialog

When i selecting *.pdf file from OpenImageEnDialog, it is not visible in the preview window of OpenImageEnDialog
w2m Posted - Feb 28 2017 : 10:39:08
If there are no errors when running or compiling but app still can not open PDF files I do not have an explanation. If the plugin is registered successfully as indicated by no errors when running the project it should function.

When I select a *.pdf file from OpenImageEnDialog here, it is visible in the preview window of OpenImageEnDialog. When it is running correctly with no errors at startup then the preview should display a pdf file.

I suspect there is something wrong with your installation or you have the dll files in a folder not accessible to the exe. When you installed did you complete filling in the parameters for your license?
The PDFLicense.inc file should have all these parameters completed:
// PDFLicense.INC
// This are the licenses codes used by registered version
// This file must not be given to anybody else.
// -------------------------------------------------------
const
WPViewPDF_DLLName = 'wPDFViewMKIMG04.dll';
WPViewPDF_DLLName64 = 'wPDFViewMKIMG04x64.dll';
WPViewPDF_BasisDLLName = 'x:\x\WPViewPDF\wPDFViewMKIMG04.dll';
WPViewPDF_LicName = 'Your full name';
WPViewPDF_LicKey = 'Your license key';
WPViewPDF_LicCode = your license code;
// -------------------------------------------------------

If the inc file is correct and the dll files are in the proper folder but your project still does not function then contact the supplier of the component. I do not have any other suggestions.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
ocuco2017 Posted - Feb 28 2017 : 10:33:04
***Sorry it was mistake in the previous Post***

*.pdf file is not previewed in preview window of OpenImageEnDialog

When i selecting *.pdf file from OpenImageEnDialog, it is not visible in the preview window of OpenImageEnDialog
ocuco2017 Posted - Feb 28 2017 : 10:29:22
with this code:
if TIEWPCubedPDF.Initialize then
TIEWPCubedPDF.RegisterPlugin
else
MessageBox(0, 'PDF decoder DLL could not be found.', 'Error',
MB_ICONERROR or MB_OK)

There is no errors when running or compiling but app still can not open PDF files.
When i selecting *.pdf file from OpenImageEnDialog, it is visible in the preview window of OpenImageEnDialog.


Remark the line in the project dpr code
I remarked //Application.MainFormOnTaskbar := True line in the demo project
and now its compiles but when running it shows error: 'PDF DLLs not found' even if they are added to the progect.exe location folder
w2m Posted - Feb 28 2017 : 09:07:26
I have errors when Running: 'PDF DLLs not found!'

In OnFormCreate:\...

Replace this:
if TIEWPCubedPDF.Initialize then
  TIEWPCubedPDF.RegisterPlugin
else ShowMessage('PDF decoder DLL could not be found');
if not TIEWPCubedPDF.IsAvailable() then
  raise Exception.create('PDF DLLs not found!');

with this:
if TIEWPCubedPDF.Initialize then
  TIEWPCubedPDF.RegisterPlugin
  else
    MessageBox(0, 'PDF decoder DLL could not be found.', 'Error',
      MB_ICONERROR or MB_OK);

Let me know if you still get an error message. If you do not get the message then your problem will be resolved.

Do the demos supplied with the WPPDF component function correctly on your pc?
No, when compiling demo i got the error: [Pascal Error] WPPDF_Multi.dpr(12): E2003 Undeclared identifier: 'MainFormOnTaskbar'
In line: Application.MainFormOnTaskbar := True;

Remark the line in the project dpr code.

The required dlls for 32-bit are:
wpdecodejp.dll
wp_type1ttf.dll
wPDFViewMKIMG04.dll

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
ocuco2017 Posted - Feb 28 2017 : 08:07:33
Hello Bill,

Did you place the dll file in the same folder as the compiled exe?
Yes, i did. I copied *.dll files (wp_type1ttf.dll, wpdecodejp.dll, wPDFViewDemo04.dll) from WPViewPDF Folder created after PDFViewMakeImage4.exe installation and pasted them to the same folder as my compiled exe.

Do you get any errors when starting the demo?
I have no errors when Building, Compiling
I have errors when Running: 'PDF DLLs not found!'

Is OnFormCreate event executed by your demo?
Yes, it is. In my Form properties: in line 'OnCreate' - 'FormCreate' procedure is placed.

Do the demos supplied with the WPPDF component function correctly on your pc?
No, when compiling demo i got the error: [Pascal Error] WPPDF_Multi.dpr(12): E2003 Undeclared identifier: 'MainFormOnTaskbar'
In line: Application.MainFormOnTaskbar := True;


In addition, one of *.dll files from WPViewPDF Folder created after PDFViewMakeImage4.exe installation is DEMO: wPDFViewDemo04.dll
can it cause the issue?

Thank you
Nataliya
w2m Posted - Feb 27 2017 : 13:17:40
When I test your demo here, the pdf files are shown in the OpenImageEnDialog and if you select a pdf file in the dialog the preview displays the pdf file. My guess is that WPViewPDF is not initialized correctly. Did you place the dll file in the same folder as the compiled exe? Do you get any errors when starting the demo? Is OnFormCreate event executed by your demo? Do the demos supplied with the WPPDF component function correctly on your pc? Also remove this: OpenImageEnDialog1.Filter := 'All files (*.*)|*.*'; This is not necessary and is not needed. The OpenImageEnDialog1.Filter is automatically initialized and includes the pdf file format in the common graphics file filter item as well as in the Portable Document Format (*.pdf) filter.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
ocuco2017 Posted - Feb 27 2017 : 12:05:00
I'm trying to use WPViewPDFMakeImage to convert *.pdf file format to *.jpg file format.

I need help on how to implement WPViewPDFMakeImage into application to allow to select PDF file , convert it to jpg and display in form using ImageEn.

I used the instruction from wpcubed_pdf_plugin.pas that is following:

(*
Usage: Add wpcubed_pdf_plugin to your uses clause and call this code:

Then this variables need to be initailized, 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 do this:

{$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)
*)

To implement it i created following Unit:

********************************************************************
unit UnitTest;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, imageenview, ieview, iemview, ieopensavedlg, StdCtrls, ComCtrls, wpcubed_pdf_plugin;

{--$I ie.inc}
{$DEFINE IEINCLUDEMISCPLUGINS}
{--$I PDFLicense.INC} // contains DLLname and License for WPViewPDF


type
TForm7 = class(TForm)
Edit1: TEdit;
Button1: TButton;
OpenFile: TButton;
ProgressBar1: TProgressBar;
CheckBox1: TCheckBox;
Previous: TButton;
Next: TButton;
OpenImageEnDialog1: TOpenImageEnDialog;
ImageEnMView1: TImageEnMView;
ImageEnView1: TImageEnView;
lblPos: TLabel;
//OpenDialog1: TOpenDialog;
procedure FormCreate(Sender: TObject);
procedure OpenFileClick(Sender: TObject);
procedure PreviousClick(Sender: TObject);
procedure NextClick(Sender: TObject);
procedure OpenImageEnDialog1CanClose(Sender: TObject;
var CanClose: Boolean);

private
{ Private declarations }
procedure UpdateStatus;
public
{ Public declarations }
end;

var
Form7: TForm7;


implementation

uses
imageenio;

{$R *.dfm}


procedure TForm7.FormCreate(Sender: TObject);
begin
ImageEnMView1.SetModernStyling();
lblPos.caption := '';
if TIEWPCubedPDF.Initialize then
TIEWPCubedPDF.RegisterPlugin
else ShowMessage('PDF decoder DLL could not be found');
if not TIEWPCubedPDF.IsAvailable() then
raise Exception.create( 'PDF DLLs not found!' );
end;

procedure TForm7.NextClick(Sender: TObject);
begin
ImageEnMView1.Seek( ieioSeekNext );
UpdateStatus();
end;

procedure TForm7.OpenFileClick(Sender: TObject);
begin
//OpenDialog1.Filter := 'All files (*.*)|*.*';
OpenImageEnDialog1.Filter := 'All files (*.*)|*.*';
//if OpenDialog1.Execute(Handle) then

if OpenImageEnDialog1.Execute then
begin
ImageEnMView1.Clear();
ImageEnMView1.LoadFromFileOnDemand(OpenImageEnDialog1.FileName );
ImageEnMView1.SelectedImage := 0;
UpdateStatus();
end;
end;



procedure TForm7.OpenImageEnDialog1CanClose(Sender: TObject;
var CanClose: Boolean);
begin

end;

procedure TForm7.PreviousClick(Sender: TObject);
begin
ImageEnMView1.Seek( ieioSeekPrior );
UpdateStatus();
end;

procedure TForm7.UpdateStatus;
begin
// Copy image
if ImageEnMView1.SelectedImage>=0 then
ImageEnMView1.CopyToIEBitmap( ImageEnMView1.SelectedImage, ImageEnView1.IEBitmap );
ImageEnView1.Update();

lblPos.caption := format( 'Page %d of %d', [ ImageEnMView1.SelectedImage + 1, ImageEnMView1.ImageCount ]);
Previous .Enabled := ImageEnMView1.SelectedImage > 0;
Next .Enabled := ImageEnMView1.SelectedImage < ImageEnMView1.ImageCount - 1;
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;

{-$DEFINE WPVIEW_AUTOINIT} // If defined, explicit call of TIEWPCubedPDF.RegisterPlugin is not required.


end.
************************************************************************

But it allows to open only Common Graphic Files but not PDF files
Any suggestions?
VersatileSoftware Posted - Sep 29 2016 : 18:14:21
Ok, I put

{$I ie.inc}

after the first uses clause. I also noticed there are two {$I PDFLicense.INC}. I deleted the first one. Also, (ImageEn support) the ie.inc is not included in the Delphi XE5 directory but was found in the DelphiSeattle10 Directory. I had to copy it over into the DelphiXE5 directory for Delphi XE5 to see the ie.inc file.

After these changes, the plugin now loads correctly.

Thanks for all your help.
Ron
wpsupport Posted - Sep 29 2016 : 01:20:45
Please also make sure the program find the WPViewPDF DLLs right where the EXE is.

For 32bit apps required are:
wpdecodejp
wPDFViewMKIMG04
wp_type1ttf


WPCubed Support
wpsupport Posted - Sep 29 2016 : 01:16:07
Hello,

sorry, about the problem with the INC files.

{$I ie.inc}

must be after the uses clause.

{$I PDFLicense.INC} comes later in the code, inside of
{$IFDEF IEINCLUDEMISCPLUGINS}


Did you install the latest ImageEn edition?

TIEWPCubedPDF is defined only if IEINCLUDEMISCPLUGINS was defined, too.


The PDFEdit exe was somehow wrong, it tried to load the MakeImage DLL although it can only work with the provided Demo. That has been fixed.


WPCubed Support