views:

1049

answers:

3

Hi,

I'm working on a calculation program which creates graphs from input data with ZedGraph. My client would like to embed those graphics into Microsoft Word and the publish the document as PDF. Both PNGs and enhanced metafiles produce badly rastered results in the PDF.

I've tested this with Office 2007 and the "built-in" PDF publisher.

Can you recommend any workflow that leads to not breaking the vectorized data on the way to PDF?

Update

Thanks for all answers. It turned out, that .net actually doesn't create metafiles when writing to disk. See the respective question. Once I started using P/Invoke to create real metafiles on disk (instead of the automatic PNG fallback) the quality of the generated PDFs and prints improved vastly.

+1  A: 

What about embedding Excel graphs?

richardtallent
A: 

If all else fails, you might try creating your PNG files at crazy-high resolution. This might make the rasterization fine-grained enogh to not be noticeable.

RolandTumble
Been there, done that. Going too far just confuses the graphics library I'm using (ZedGraph). At 300dpi it barely works, but the word starts to choke on the document size and zooming into the PDFs still looks terrible and reveals aliasing/rasterization artifacts.
David Schmitt
A: 

I don't know anything about ZedGraph, but if you can export to (or somehow get to) an EPS file, that should work.

I often need to get vector artwork out of a PDF for use in Word, and to do this I usually go via Adobe Illustrator to save as an EPS. [Illustrator just happens to be something that I have available - I'm not saying there's anything magical about it; you may be able to create EPS files via another route.]

I see you're using Office 2007 and I can't say I have much experience with that, but the situation with Word 2003 is that you can insert an EPS that was exported from Adobe Illustrator if you choose "Illustrator 8.0" format when exporting from Illustrator. Newer versions of Illustrator seem to create files that Word 2003 can't handle. (Word 2007 may be better in this respect).

Gary McGill