VPE printing with .WMF graphic

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

VPE printing with .WMF graphic

Postby JudgeTerry » Thu Mar 25, 2010 5:44 pm

I can create a .WMF file using the following VPE commands:

Code: Select all
VpeSetTextColor(hDoc, XRGB(230,230,230))
VpeSetFontName(hDoc, "Bradley Hand ITC")
VpeSetFontSize(hDoc, 100)
VpePrint(hDoc,500,500,"COPY")
VpeSetPictureType(hDoc,PIC_TYPE_WMF)
VpePictureExport(hDoc,"c:\Copy_WM.wmf",1,550,520,1350,840)


This creates the file (copy_wm.wmf) with no problem. However when I use the graphic in a new document as follows:

Code: Select all
VpePicture(hDoc, 200, 1100, VFREE, VFREE, "c:\copy_wm.wmf")


The graphic is added and the preview looks fine, but the image does not print! If I add .JPG, .BMP, or .TIF images they print just fine.

Any ideas on what I am doing wrong??

Terry Wolfe
JudgeTerry
 
Posts: 30
Joined: Thu Jan 22, 2009 10:56 pm

Postby IDEAL Software Support » Fri Mar 26, 2010 2:01 pm

Your code is not correct. You are not exporting the text "COPY" to WMF with its full bounding rectangle.

The correct code is:
Code: Select all
VpePrint(hDoc, 500, 500, "COPY");
VpeCoord right = VpeGet(hDoc, VRIGHT);
VpeCoord bottom = VpeGet(hDoc, VBOTTOM);
VpeSetPictureType(hDoc, PIC_TYPE_WMF);
VpePictureExport(hDoc, "c:\\Copy_WM.wmf", 1, 500, 500, right, bottom);


This ensures that the text is exported with its true bounding rectangle. This is important when exporting to metafile formats (for bitmaps it isn't).

The WMF created with the above code can be imported and printed correctly - tested with VPE v6.0.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

VPE printing with .WMF graphic

Postby JudgeTerry » Fri Mar 26, 2010 5:12 pm

Thanks,

This works just fine. I had thought that I could use smaller dimensions to crop the image. But it makes sense that this would not work with vector graphics.

Terry
JudgeTerry
 
Posts: 30
Joined: Thu Jan 22, 2009 10:56 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 20 guests

cron