• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Printing & page size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Prev by Date: Re: What's the fastest way to get icons for file/folders?
  • Next by Date: Re: Re: NSPopUpButton inside Table CornerView
  • Previous by thread: Re: Receiving actions from WebViews
  • Next by thread: Re: Is there a way to change a buttons text color for the title?
  • Index(es):
    • Date
    • Thread