• 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 header and footer when user says to scale
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

printing header and footer when user says to scale


  • Subject: printing header and footer when user says to scale
  • From: Ken Victor <email@hidden>
  • Date: Mon, 10 Oct 2005 17:16:43 -0700

(i've spent most of the day on this with no luck! :-( )

i have a subclass of NSOutlineView that i use solely for printing. this is working fine for me. the main reason for the subclass is that i completely expand the outline when its printed, regardless of how much or little the user has expanded it. and i can print it properly even when the user has set a scale factor in the page setup dialog.

as long as the user specified scale factor (in the page setup dialog) is 100%, i can also successfully print headers and footers. they print at the size and location i've specified (programmatically). i use the basic code provided by the documentation:

http://developer.apple.com/documentation/Cocoa/Conceptual/Printing/Tasks/PaginatingViews.html#//apple_ref/doc/uid/20000912-BBCHHAHI

however, as soon as the user (me in this development environment) specifies a scale factor other than 100%, i can't get the header and footer to show up in the right size or location. i finally tried a simple test: using text edit, i turned on print page numbers, and then printed with various scale factors. and lo and behold, textedit was exhibiting the same behavior i get.

note that i believe i can get the right size text for my header and footer by dividing the font size by the scale factor obtained from the current printinfo dictionary. and i also seem to be able to get roughly the proper x location by similarly scaling the x offset for the text (drawn via drawAtPoint). and lastly, the footer also seems to draw at the right location by similar scaling. but... for the life of me, i can't get the header positioned vertically correctly. if the user specified scale factor is less than 100%, the header prints lower on the page than it should; if the user scale factor is greater than 100%, then the header doesn't print at all as it is apparently positioned above the top of the page.

note that thus far, i've only been using left justified header and footer. i believe a similar problem would occur if i tried to print right justified header and footer.

has anyone else experienced this behavior? if so, could you please let me know how you worked around it. if others haven't experienced this, could someone please point me to some sample code that works and/or some documentation beyond that mentioned above.

thanx in advance,
ken
_______________________________________________
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: CoreData XML error while saving
  • Next by Date: lineBreakBeforeIndex Question
  • Previous by thread: Re: CoreData - KVO on unarchived array/dictionary elements?
  • Next by thread: lineBreakBeforeIndex Question
  • Index(es):
    • Date
    • Thread