EMF-File appears white

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

EMF-File appears white

Postby DDTech » Fri Jun 03, 2011 5:00 pm

Hi,

I have a gdi+ - application that creates a chart and is able to save the result in an emf-file (png, jpg... work as well but emf would be perfect).
Trying to print this file results in a white rectangle. The file shows fine in Word, outlook etc. but irfanview also presents just plain white.
So this is not necessarily a vpe-problem, but maybe a file-format problem.

any idea where to look or what to do?

a sample-file can be found here:

http://www.personalplanung.com/tmp/vpechartsample.zip

thanks for any help

regards

Frank
DDTech
 
Posts: 37
Joined: Mon Oct 26, 2009 11:45 am

Re: EMF-File appears white

Postby IDEAL Software Support » Mon Jun 06, 2011 8:01 am

We didn't look at the file - we can do so in the scope of our premium support. But make sure that the file header contains correct information about dimensions and scaling.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Re: EMF-File appears white

Postby potjerm » Wed Feb 08, 2012 9:07 pm

In case Frank or anyone else is still looking for a solution to this, I believe the problem is the file format. Apparently there are 3 EMF file formats:
  • EMF - this format contains only GDI records. It can be rendered using GDI or GDI+
  • EMF Plus Only - this format contains only GDI+ records. It can only be rendered using GDI+ (but is much smaller in size than the GDI version of EMF)
  • EMF Plus Dual - this format contains both GDI and GDI+ records. It can be rendered using GDI or GDI+, but when rendering in GDI it uses the GDI info, and when rendering in GDI+ it uses the GDI+ info (which apparently can produce better results)
My situation sounds exactly like Frank's - I was generating a chart, saving it as EMF, and attempting add the EMF file to a VPE document. (Maybe Frank and I are even using the same tools to do it!) Anyway, I, too, was only getting a blank rectangle in my document, whereas other file formats worked fine. I finally discovered that the charting tool was using the EMF Plus Only format. Since the charting tool is open source, I was able to change the EMF format, and I found that either of the other 2 formats, EMF or EMF Plus Dual, worked perfectly with VPE. I assume that VPE is using the older GDI API, and that's why the EMP Plus format doesn't work. I am using VPE 6.10, BTW.

Hope this helps!
Mike
potjerm
 
Posts: 6
Joined: Tue Apr 15, 2008 1:42 pm
Location: Wyoming, MI USA

Re: EMF-File appears white

Postby IDEAL Software Support » Thu Feb 09, 2012 12:31 pm

Thank you for the information - we didn't know about EMF Plus and EMF Plus Dual. At the time when we implemented EMF, there was no other EMF format. And you are right, VPE uses GDI.

BTW, what open source charting tool are you using?
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Re: EMF-File appears white

Postby potjerm » Thu Feb 09, 2012 3:17 pm

IDEAL Software Support wrote:Thank you for the information - we didn't know about EMF Plus and EMF Plus Dual. At the time when we implemented EMF, there was no other EMF format. And you are right, VPE uses GDI.

BTW, what open source charting tool are you using?


You are welcome, I hope you found it useful. Since my EMF files worked in the couple other places I tried them, but not in VPE, I assumed there must some difference in the file format. The "Pictures" topic in the VPE 6.1 Programmer's Manual mentions different header formats in WMF files, and that is actually what gave me the idea that there might be other EMF formats. So congratulations on your excellent help files! I found the information about the different EMF Formats here:
http://msdn.microsoft.com/en-us/library/system.drawing.imaging.metafiletype.aspx

The charting tool I am using is called FoxCharts, an excellent charting tool for Visual FoxPro which uses GDI+. You can find out more about it here:
http://vfpx.codeplex.com/wikipage?title=FoxCharts&referringTitle=Home

If you are curious, it was the documentation for GDIPlusX, which is used by FoxCharts, that led me to the MSDN site:
http://vfpx.codeplex.com/wikipage?title=GDIPlusX%20References&referringTitle=GDIPlusX
potjerm
 
Posts: 6
Joined: Tue Apr 15, 2008 1:42 pm
Location: Wyoming, MI USA

Re: EMF-File appears white

Postby DDTech » Thu Jan 08, 2015 7:33 pm

Mike,

thanks for the private mail You sent me at that time. I just fell over Your answer here too.

potjerm wrote:... My situation sounds exactly like Frank's - I was generating a chart, saving it as EMF, and attempting add the EMF file to a VPE document. (Maybe Frank and I are even using the same tools to do it!)


yup, also FoxCharts
DDTech
 
Posts: 37
Joined: Mon Oct 26, 2009 11:45 am


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 19 guests