How do I scale to real-world units when generating printed output from a Cocoa app?

152 Views Asked by At

I am writing a specialized CAD tool in Cocoa. The tool reads "Gerber" files that contain precise dimension information and very fine details, and it needs to produce printed output that exactly corresponds to the specifications (assuming they're within the capabilities of the print device).

I can easily scale my drawing to any resolution, but how do I get accurate resolution info for the print destination device inside my -drawRect: method?

Digging around in the docs, I see where I could get at some of the resolution info presented in the Print Setup dialogs; however, I don't believe that info is detailed enough. For example, it will typically say that an inkjet printer is 600 DPI, when the actual device does not produce square dots (e.g. the "real-world" resolution might be something like 620x400 DPI).

[There is an interesting article that explains in detail why knowing the hardware resolution is critical to avoiding rasterization artifacts in printed output.]

0

There are 0 best solutions below