Printing & page size
Printing & page size
- Subject: Printing & page size
- From: Aidas Dailide <email@hidden>
- Date: Fri, 18 Aug 2006 19:37:17 +0300
Hi there,
It seems that there is no proper way to determinate the maximum
printable area. I've tried to use imagePageBounds, but it still gives
me wrong margins.
Anyone has any sample code that returns maximum printable area? I've
included my way of doing that, but it doesn't work properly. For some
reason the top margin is only 18 (should be around 50, to be the
truth and visible).
Regards,
Aidas
Here is the code I use to set my NSPrintInfo:
[printInfo setLeftMargin:imageablePageBounds.origin.x];
[printInfo setBottomMargin:imageablePageBounds.origin.y];
[printInfo setTopMargin:(paperSize.height-
imageablePageBounds.size.height-imageablePageBounds.origin.y)];
[printInfo setRightMargin:(paperSize.width-
imageablePageBounds.size.width-imageablePageBounds.origin.x)];
Here is the method to return maximum page size:
-(NSSize)pageSize
{
NSSize pageSize=[[_mnDocument printInfo] paperSize];
pageSize.height-=[[_mnDocument printInfo] bottomMargin]; //margins
are the ones defined by imageablePageBounds when setting nsprintinfo
pageSize.height-=[[_mnDocument printInfo] topMargin];
pageSize.width-=[[_mnDocument printInfo] leftMargin];
pageSize.width-=[[_mnDocument printInfo] rightMargin];
return pageSize;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden