Pictures disappears in .vpe- files when emailing

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Pictures disappears in .vpe- files when emailing

Postby Bengt » Tue Mar 27, 2007 10:26 am

When mailing vpe-documents, pictures in the document disappear. Rectangle with a cross inside are shown where the pictures should be. The pictures are printed to the document with VpePicture and shown in preview. If I mail the document to my own mailadress on the same computer as my development system, the pictures show up, but if I mail to others, they disappear.

When I email to one of my other emailaddresses where I use Eudora, the file extension .vpe disappear. The received files are named vpe, vpe1, vpe2 etc with no extension. Therefore, Vpe Viewer doesn't recognize them as vpe files.

I use VPE ver 3.2 and the VPE for VDF class library from StarZen

Regards
Bengt Håkansson
Bengt
 
Posts: 89
Joined: Fri Jan 27, 2006 5:29 pm

Postby IDEAL Software Support » Tue Mar 27, 2007 1:02 pm

You either need to embed the images into the VPE document file, or you need to send the images also. In the latter case it is recommended that the relative path of the used images is the same as the document path itself. I.e. if you create the document in the path c:\tmp, then the referred images should be located there also. Since VPE stores the relative paths of the images in documents, the documents can be moved into any location (together with the referred images).

Embedding the images directly into the VPE document files is an alternative: In VPE versions less than v4.0, images are not embedded into VPE document files by default. To do so, specify PIC_IN_FILE as an additional flag to the Picture() method, e.g.

Code: Select all
Picture(100, 100, VFREE, VFREE, "example.jpg", PIC_KEEPIMAGE + PIC_IN_FILE)


Note that embedding images in VPE versions less than v4.0 is very costly regarding the file size of the written VPE document file, because each image is embedded in uncompressed form and it is embedded as many times as there are picture objects referring to it.

In v4.0 this has been drastically improved: Images are stored in VPE document files in their original format (tif, jpeg, png, gif, etc.), if the format is a compressing format. If the original file is not compressed (e.g. bmp, wmf, emf, etc.), VPE will compress it using ZLib compression.
Furthermore an image is only embedded once within a VPE document file, regardless of how many picture objects are referring to it.

This all is explained in the manuals.

Regarding your second problem:
If VPE View is installed and Eudora does not handle the VPE extension, it is a problem of Eudora. Outlook, Outlook Express and Thunderbird do work for example.

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1622
Joined: Thu Nov 18, 2004 4:03 pm

Must images in mails be saved before they can be shown?

Postby Bengt » Wed Mar 28, 2007 9:40 am

PIC_IN_FILE produce huge files. I added a 55 k jpg-logo to a 34 k vpe-file and got a file of 4 Mbyte. That will not work in my application.

I found the description of how pictures are handled in the manual under VpeWriteDoc. There, you "recommend to keep the images in the same directory as the VPE Document file".

I tried to follow this advice by having the pictures in my application directory and printing to the document with VpePicture and image name without path. To get an understandable name of the .vpe-file I use VpeWriteDoc (FileName) where FileName has no path included.

The first problem, i think, was that my application directory was not current directory when executing my program. Dataflex set the path to different used maps in a workspace file so the program work, but wrong path names were probably stored in the .vpe-files. Is there any possibility to check what path is stored there?

However, I changed the current directory by statement in my program to always point to the program path and the problem seemed to be solved. It seemed to work nice at home yesterday, I could send the document to another computer using another Outlook account and the pictures showed up.

To be really sure, I made a test in the same way at work this morning. I send the document to another computer with another Outlook account. No pictures were shown when I clicked at the .vpe-file on the mail !!! The picture files were ofcourse included in the mail. So, after all, my solution did not work.

I made a new map on the receiving computer, saved the files there, clicked on the saved .vpe-file. The images were shown. After that, I can click on the .vpe-file in the mail and the images are shown.

Then I sent a new mail, exactly as the first, clicked on the .vpe-file in the mail. No images shown. After saving the images, they were shown.

Conclusion: The images included in the mail must be saved on the receiving computer before they are shown when clicking on the vpe-file in the mail. It does not even help that the image file has been saved before. Saving seems to set the path to the image. The image is only shown when clicking on the vpe-file in the mail if images from that mail have been saved.

Should it really be so?

This means that the mail receiver must save the image files in a separate directory on his computer before he can look at the .vpe-file and see the images. I never use to save mail attachments like that. Mail attachments are stored by outlook and you can go back to old mails and open attachments in Outlook.

If this is how it works, I think attaching PDF-files is the only acceptable solution before VPE 4.0 comes.

Regards,
Bengt Håkansson
Bengt
 
Posts: 89
Joined: Fri Jan 27, 2006 5:29 pm

Postby IDEAL Software Support » Wed Mar 28, 2007 10:45 am

VPE v3.60 and higher convert full paths of pictures into paths relative to the VPE document file. Lower versions don't do that. Relative paths can only be created, if the VPE document file and the images are on the same drive.

In your case (v3.20), you need to specify yourself the relative path. And since it is recommended for e-mailing to use the same path as for the VPE document file (otherwise directories need to be created on the receiving computer and the images need to be moved to those directories), the relative path you specify must be EMPTY.

e.g. you write the VPE document to c:\tmp

Then all images need to be in c:\tmp and the current path must be c:\tmp.

And all calls to the picture method must have an empty path, i.e. "example.jpg" and NOT "c:\tmp\example.jpg".

As explained above, this applies to versions lower than v3.60.

Regarding large document files: VPE v4.0 will solve this problem as explained in my previous post.

An alternative would be to e-mail the VPE document as PDF.

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1622
Joined: Thu Nov 18, 2004 4:03 pm

Opening VPE-files in the mail?

Postby Bengt » Wed Mar 28, 2007 12:11 pm

If I save the E-mailed files in a map on the receiving computer, it is no problem. Pictures are shown.

But what about opening the vpe-file IN THE MAIL where also the pictures are attached? Is it possible to get that working in VPE 3.2 or should I give it up?

I tried also specify the path in VpeWriteDoc,
VpeWriteDoc("c:\currentdir\filename"). Then both the .vpe-file and the the picture are stored in my currentdir.

The files are then added to the mail with
VpeAddMailAttachment("c:\currentdir\filename"). If c:\currentdir is not included, the mail program do not show up.

No pictures were shown on the receiving computer.

Regards,
Bengt
Bengt
 
Posts: 89
Joined: Fri Jan 27, 2006 5:29 pm

Postby IDEAL Software Support » Wed Mar 28, 2007 6:42 pm

c:\currentdir\ is not a relative path. Relative paths are: ..\dir\dir or .\dir\dir or ..\..\dir ... etc.

>>
But what about opening the vpe-file IN THE MAIL where also the pictures are attached? Is it possible to get that working in VPE 3.2 or should I give it up?
<<

This would require that VPE communicates with the e-mail client to extract the attached images. Or that the client extracts the attached images itself. The short answer is: this is not possible.

Best you wait for VPE v4.0 or use the PDF export feature of VPE v3.60.

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1622
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 70 guests