Friday, August 08, 2008

Enhanced metafile size in Word

My application creates enhanced metafiles to paste into Word. When I create a 100x100mm metafile, it appears in Word as 89x90mm. It so happens that this discrepancy is the difference between my screen's real DPI (~89 horizontal, ~90 vertical) and the notional 96DPI it reports itself as. (My metafiles use my screen as their reference device.)

The metafile contains the original size and resolution of the original output device so Word certainly has the information required. I guess it is trying to ensure that its real size on screen is reflected in print.

I have observed that Visio metafiles paste into Word at the correct size. When I examine them I can see that Visio has intentionally made them larger. (That is, ENHMETAFILEHEADER.rclBounds is exagerated.)

Word metafiles also paste correctly into Word. When I examine them I see that they have been rendered using a printer as the reference device. I am not sure whether this is a real printer, or some ideal DEVMODE that will produce nice output.

Which is the correct strategy? Can anyone help explain what Word is doing/thinking?

0 Comments:

Post a Comment

<< Home