On 28 Aug 2014, at 15:01, Keary Suska <[email protected]> wrote:

> On Aug 28, 2014, at 7:20 AM, Ben <[email protected]> wrote:
> 
>> I'm trying to make a tool for myself to fill in some repetitive forms. 
>> They've got a custom paper size with a series of boxes to be filled in.
>> 
>> Given that I know the dimensions of the paper and the locations and 
>> dimensions of the boxes to fill in, I should be able to draw a view that 
>> prints onto these sheets. However, I'm getting lost in the printing system 
>> trying to figure out what steps I need to take to get this working.
>> 
>> I don't understand how to go from the physical paper size (say 80mm wide, 
>> 150mm tall) to the paper size Cocoa wants in points. Is there a method that 
>> gives a scaling factor from points to any physical unit?
>> 
>> I'll also need to precisely position drawn strings in the view to print, so 
>> will presumably need to translate points to physical dimensions when drawing 
>> too.
>> 
>> Can anyone point me to something that might explain how to proceed here?
> 
> As the docs say, sizes are measured in the user coordinate space: 
> https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CocoaDrawingGuide/Transforms/Transforms.html#//apple_ref/doc/uid/TP40003290-CH204-SW5
> 
> This guide is important to read as well.
> 

I've read that before, but not thought to apply it to print devices.

If I understand correctly, I should basically just work everything out at 72dpi 
(the assumed user space scale) and let the system sort out the scaling for the 
printer?

So for my case, assuming 72dpi ≈ 2.8 dots/mm:
The paper being 80mm wide should be set to 224 points wide
To inset a label by 10mm from an edge, I should inset by 28 points?

Am I understanding this right?


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to