VPE7: Picture embed in Template/in Finale Document

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

VPE7: Picture embed in Template/in Finale Document

Postby Hans Fuchs » Tue Sep 23, 2014 1:50 pm

Hello,

please refert to my issue Tue Apr 29, 2014 2:11 pm.

I tested VPE7/Dycodoc 2.3.0.7730 and it did NOT work in my development environment (now Delphi XE5) and NOT on a User-Installion .

In the Picture-style section i checked the Options "Embed in Template" and "Embed in Document", in the General section the Options "Include in Previews", "Include in Prints" and "Include in Streams".
Used Files: BMP and PNG.
I deployed vpei3270.dll and vJavaScript3270.dll.

Loading a Picture without checked Picture-style Options is the only way to see it in the preview.

Where is the problem?
Hans Fuchs
 
Posts: 13
Joined: Mon Mar 17, 2014 9:25 am

Re: VPE7: Picture embed in Template/in Finale Document

Postby IDEAL Software Support » Tue Sep 23, 2014 4:27 pm

We tested it right now once again, because there is always a chance of a regression bug, but it is working here.

When a bitmap file is embedded into a template file, you can see that the file size of the template is larger, compared to a template where the bitmap file is only stored as a link. If it does not work for you, please send the DCD and TPL file to our support e-mail address.

But first, please make sure that your application is loading the correct version of VPE, as well as the updated template file.
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm

Re: VPE7: Picture embed in Template/in Finale Document

Postby Hans Fuchs » Thu Sep 25, 2014 9:35 am

I have found the problem, thank you for your help.

I deleted the tpl-file just after DumpTemplate(...).

Deleting the tpl-file in the destructor, after the preview, solved the problem.

Conclusion: DumpTemplate(...) does not move pictures to the document!?
Hans Fuchs
 
Posts: 13
Joined: Mon Mar 17, 2014 9:25 am

Re: VPE7: Picture embed in Template/in Finale Document

Postby IDEAL Software Support » Thu Sep 25, 2014 6:39 pm

Please see in the help file titled "Programmer's Manual", chapter "Programming Techniques", subchapter "Pictures", section "Image Cache". I would like to point out the paragraph, where it is written: "Therefore you may not delete or overwrite image files, which are currently used in any open document of your application."

Indeed, the paragraph talks about image files on disk, but not about image files stored in template files. You are the first one, who deletes a template file after it has been dumped (for whatever reasons). But the same applies to VPE document files (VPE's native document file format): If you are reading a VPE document file into a new document (you can read many document files one after the other into the current document to assemble a new document), and such VPE document files contain embedded images, you may not delete the files. This is explained in the manual in the section "Pictures and VPE Document Files", but not for templates.

Here is some additional background information:
Bitmaps can be of large size, consuming a lot of memory. If you create for example a warehouse catalog with thousands of images, it is impossible to hold all images in memory. Therefore VPE has a sophisticated multi-level associative image cache, which consists of more than 15.000 lines of source code.

In the top-level, VPE holds information about an image, i.e. its type (PNG, JPG, TIF, BMP, EMF, WMF, ...), its dimensions (in pixels), resolution in DPI, etc. Now, when you are building a document, VPE retrieves this information from the image header into the top-level cache, without reading the whole image (where possible, most image types do allow this). When you are inserting such an image later many times into a document, VPE retrieves the metric dimensions of the image from its cache - without accessing the file on disk, and without accessing the bitmap bits itself.

Later, after assembling a document, when an image needs to be output to a device (screen, printer, PDF, etc.), the bitmap bits are loaded from disk into a second-level cache (in fact there is also a third level). In your case, when you dump the template into the VPE document, the image header is retrieved from the template file, without reading the whole bitmap data. This is done when you display the preview. But since you deleted the template, the image is also gone.
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 8 guests

cron