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
 WPCubed MakeImage plug in Unknown file format error

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
jrpcguru Posted - Aug 14 2022 : 14:54:05
My program which uses WPCubed MakeImage plug-in successfully displays a wide variety of PDF files that I have accumulated, until now. I just discovered that a gas company delivers monthly bills as PDF files created by "OpenText Output Transformation Engine - 16.7.65" None of these PDF files for the last year can be displayed. My program can try loading the PDF file with different DPI settings. This usually fixes problems with other PDF files, but not these files.

I should note that PDFium, Adobe Reader, and MS Edge display the files properly.

Once again, I checked the WPCubed website to confirm I'm using the latest DLL files, 10/15/2021. I also am using the latest wpcubed_pdf_plugin.pas from the ImageEn source folder.

try
ImageEnView1.IO.LoadFromFile(inName, true);
except

This does not report an exception unless I am debugging. Then the exception is Unknown file format.

if ImageEnView1.IO.LoadFromFileAuto(inName) = false then
This does not report false when it fails and does not report an exception.

if ImageEnView1.IO.Aborting = true
This does not report that it is aborting

TOpenImageEnDialog shows a blank preview for these files until I switch to ModernDialog = true, then the preview is correct.

if FindFileFormat(inName, ffContentOnly) = ioPDF then reports true
if FindFileFormat(inName, ffContentOnly) = iomscWPPDF then reports true

The only method I've found to detect the problem works after the attempted load:
if ImageEnView1.IsEmpty = true, so I am able to provide a useful error message.

Since the offending PDF file is a personal bill, I would like to be able to send it to you without worrying that it will be publicly visible. I haven't found any other source for these PDFs that don't work. I'm hoping it is something that can be corrected on your end. Otherwise it would appear that the WPCubed DLL is failing.

J.R.
6   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Sep 04 2022 : 21:26:47
Hi JR

I think you are better to contact WPCubed regarding these issues.


Nigel
Xequte Software
www.imageen.com
jrpcguru Posted - Sep 04 2022 : 18:36:01
I tried your suggested code modifications and now I do get a error code reported. Thank you.

The problem here is a three step problem. My code is the last step, so I started there to try to find the problem. You are the middle step so you were next. Now that we have eliminated both of those steps, that only leaves the WPCubed DLL file. Unfortunately they are very unresponsive.

I have now found another source of PDF files that display as blank pages. If any of your users comes across that, I found that by moving back to my oldest WPCubed DLL files, wpdecodejp.dll ver 1.2.0.1 and wPDFViewMKIMG04.dll ver 4.3.2.0, fixed the blank page problem. I have 3 versions of the DLL files and none can view the PDFs that caused me to send you this query.

J.R.
xequte Posted - Aug 15 2022 : 21:12:47
Hi JR

Correct me if I'm wrong, but there is only one thing that is failing. The PDF file does not load (an unsupported type), but LoadFromFile() does not return false (because wpcubed_pdfMakeImageExt() does not return an error result).

If you wanted, you could change the code in WPViewPDF_ReadImageStream() to something like:

         ...
         if (res >= 0) then
         begin
           IOParams.ImageCount := PageCount;
           if not Preview and (outmstream.Size = 0) then
             raise PDFException.Create('Load of PDF failed');             
           if not Preview then
           begin
                outmstream.Position := 0;
                aBitmap.LoadFromStream(outmstream);
                Bitmap.CopyFromTBitmap(aBitmap);
                if ( Bitmap.Width < 1 ) or ( Bitmap.Height < 1 ) then
                  raise PDFException.Create('Load of PDF failed');     
                IOParams.Width  := Bitmap.Width;
                IOParams.Height := Bitmap.Height;
           end;
         end
         ...


Nigel
Xequte Software
www.imageen.com
xequte Posted - Aug 15 2022 : 21:09:14
Hi JR

Correct me if I'm wrong, but there is only one thing that is failing. The PDF file does not load (an unsupported type), but LoadFromFile() does not return false (because wpcubed_pdfMakeImageExt() does not return an error result).



Nigel
Xequte Software
www.imageen.com
jrpcguru Posted - Aug 15 2022 : 10:37:10
I have not contacted WPCubed yet. I figured that since several ImageEn items were failing, it would be good to start there to make sure that ImageEn isn't improperly reacting to these PDF files. You have the advantage of being easier to contact too.

J.R.
xequte Posted - Aug 14 2022 : 16:02:48
Hi JR

Looking at the wpcubed_pdf_plugin source, it looks like an exception should be raised if the loading fails. Have you tried contacting WPCubed?



Nigel
Xequte Software
www.imageen.com