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
 WPCubed MakeImage plug in won't compile
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jrpcguru

USA
254 Posts

Posted - Jun 07 2022 :  14:00:57  Show Profile  Reply
Today I tried to compile a program which uses the WPCubed MakeImage plug in. The last time I compiled the program using IE 10.3.5 and D10.3 it succeeded. Today, using IE 11.0.0 generated errors in the plugin: wpcubed_pdf_plugin.pas

I was using a version of wpcubed_pdf_plugin.pas dated 04-27-2018, so I checked the WPCubed website. I downloaded the latest version which is dated 10-15-2021 but it had the same problem.

Two errors happened:


WPViewPDF_ReadImageStream
ImageResolution := Max(IOParams.fDpiX, IOParams.fDpiY);

This line yielded these errors:
[dcc32 Error] wpcubed_pdf_plugin.pas(202): E2361 Cannot access private symbol TIOParams.fDpiX
[dcc32 Error] wpcubed_pdf_plugin.pas(202): E2361 Cannot access private symbol TIOParams.fDpiY

class procedure TIEWPCubedPDF.RegisterPlugin();
// Register the new format
IEFileFormatAdd( TIEFileFormatInfo.Create(local_iomscWPPDF, // we only handle PDF
'Portable Document Format',
'PDF;PDFA;EPDF',
'pdf',
false,
[],
@WPViewPDF_ReadImageStream,
@WPViewPDF_WriteImageStream,
@WPViewPDF_TryImageStream) );
This line yielded this error:
[dcc32 Warning] wpcubed_pdf_plugin.pas(373): W1000 Symbol 'Create' is deprecated: 'SuitableExtension parameter is no longer required - http://imageen.com/help/Compatibility.html'

I generally don't want to mess with another author's code since I don't fully understand their code. I started by searching the ImageEn website for Change History about IEFileFormatAdd and TIEFileFormatInfo and found nothing. With the assistance of the help file, I changed the class procedure TIEWPCubedPDF.RegisterPlugin(); to:

FileFormatInfo := TIEFileFormatInfo.Create;
with FileFormatInfo do
begin
FileType := local_iomscWPPDF;
FullName := 'Portable Document Format';
Extensions := 'PDF;PDFA;EPDF';
SuitableExtension := 'PDF';
InternalFormat := False;
DialogPage := [];
ReadFunction := WPViewPDF_ReadImageStream;
WriteFunction := WPViewPDF_WriteImageStream;
TryFunction := WPViewPDF_TryImageStream;
end;
IEFileFormatADD(FileFormatInfo);

For the first two lines of code, I changed to:
ImageResolution := Max(IOParams.DpiX, IOParams.DpiY);

So far, my tests show this compiles and works correctly. I would feel better if this was confirmed by you experts. And if it is confirmed, perhaps this error report will save someone else a bunch of research.




J.R.

xequte

38296 Posts

Posted - Jun 07 2022 :  15:06:25  Show Profile  Reply
Hi JR

You should use the latest version of wpcubed_pdf_plugin.pas which is included in the ImageEn source folder.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: