从 Cocoa 应用程序生成打印输出时,如何缩放到实际单位?
我正在用 Cocoa 编写一个专门的 CAD 工具。该工具读取包含精确尺寸信息和非常精细的细节的“Gerber”文件,并且需要生成完全符合规格的打印输出(假设它们在打印设备的能力范围内) 。
我可以轻松地将绘图缩放到任何分辨率,但是如何在 -drawRect: 方法中获取打印目标设备的准确分辨率信息?
在文档中深入研究,我发现可以在哪里获得“打印设置”对话框中显示的一些分辨率信息;但是,我认为该信息不够详细。例如,当实际设备不产生方形点时,通常会说喷墨打印机的分辨率为 600 DPI(例如,“真实世界”分辨率可能类似于 620x400 DPI)。
[有一篇有趣的文章详细解释了为什么知道硬件分辨率是对于避免打印输出中的光栅化伪影至关重要。]
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.]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论