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
 TImageEnMView.MIO.LoadFromFileZIP
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

JonMRobertson

USA
32 Posts

Posted - Apr 28 2024 :  13:10:33  Show Profile  Reply
When TImageEnMView.MIO.LoadFromFileZIP loads a PDF from a .ZIP file, only the first page of the PDF is loaded. If I load the same PDF using LoadFromFilePDF, all pages are loaded in the TImageEnMView.

Is this expected when loading from a ZIP file?

I am using ImageEn 12.5. I have not tested in a newer version but didn’t notice anything mentioned in release notes or the forum.

I emailed a sample project and my email was rejected:

550 5.0.350 One or more of the attachments in your email is of a file type that is NOT allowed by the recipient's organization.

Thanks

xequte

38627 Posts

Posted - Apr 28 2024 :  20:03:27  Show Profile  Reply
Hi Jon

This is expected. When loading the contents of a zip file, only the first frame/page of each image is shown. Possibly we might look at loading all pages of an image (e.g. when the zip file contains only one file), but that will be in a later version.

Unfortunately our mail system blocks some types, like EXE files.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

JonMRobertson

USA
32 Posts

Posted - Apr 29 2024 :  08:07:18  Show Profile  Reply
 
Possibly we might look at loading all pages of an image (e.g. when the zip file contains only one file), but they will be in a later version.

Thanks. I can manually extract using Delphi's TZipFile. I only tried LoadFromFileZIP because it was available.

Another option would be to overload LoadFromFileZIP:
function TImageEnMIO.LoadFromFileZIP(const FileName: string; const Index: Integer; const Password: string = ''): Boolean; overload;
function TImageEnMIO.LoadFromFileZIP(const FileName: string; const ImageName: string; const Password: string = ''): Boolean; overload;

Although I am not familiar with 7z.dll. I took a quick glance but did not see how difficult it would be to extract a single file using an index or item name. It is trivial using TZipFile.
 
Unfortunately our mail system blocks some types, like EXE files.

A lot of email servers will block EXE files. My attachment was a .zip that contained project source (all text) and one zip that contained a PDF. The zip was the only binary file in the zipped attachment.

Thanks Nigel.
Go to Top of Page

JonMRobertson

USA
32 Posts

Posted - Apr 29 2024 :  08:15:40  Show Profile  Reply
 
Although I am not familiar with 7z.dll. I took a quick glance but did not see how difficult it would be to extract a single file using an index or item name.

Now I feel silly. I just noticed TImageEnMIO.ExtractZIP_SevenZip, which has parameters for using an index.

Jon
Go to Top of Page

xequte

38627 Posts

Posted - Apr 29 2024 :  23:47:46  Show Profile  Reply
Hi Jon

I'm not sure that will do what you are looking for. You'd need to fill the TImageEnMView with ZipPath+PageIndex for each page in the PDF file (and know how many pages it contained). There is just not a good way to do that at present.

When you pass a PDF file to LoadFromFilePDF(), the PDF is the container and TImageEnMView shows each of its objects (which are the pages). With LoadFromFileZip, the Zip is the container, and its objects are the files it contains. It makes no effort to check whether those files themselves contain objects/pages. That would only be useful in the situation where a zip file contains precisely one file, which should then be unwrapped.

Probably the easiest way at present is to extract the zip to a stream or temporary file and pass that to TImageEnMView.MIO.LoadFromStream/FilePDF().


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

JonMRobertson

USA
32 Posts

Posted - Apr 30 2024 :  08:43:35  Show Profile  Reply
 
Probably the easiest way at present is to extract the zip to a stream or temporary file and pass that to TImageEnMView.MIO.LoadFromStream/FilePDF().


That is what I'm doing.

 
I'm not sure that will do what you are looking for.


I was offering a suggested enhancement. That's all.
Go to Top of Page

xequte

38627 Posts

Posted - May 14 2024 :  00:25:45  Show Profile  Reply
Maybe in a later update

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