• 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
WebView pagination for printing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

WebView pagination for printing


  • Subject: WebView pagination for printing
  • From: Gideon King <email@hidden>
  • Date: Wed, 21 Jul 2010 02:19:44 +1000

Hi, my original quest was to print a table view with pagination and headers, but when I initially tried it, I didn't see how I could include the column headings in it, and found on the lists the suggestion to use a WebView and put the data in there to print it.

When I tried it, I see that it just puts the content in the middle of the page and I haven't got my headers and footers in there. I am trying to print [[[webView mainFrame] frameView] documentView] as per the mailing list item I found, but I also see that the frameView has:
	• – canPrintHeadersAndFooters
	• – printOperationWithPrintInfo:
	• – documentViewShouldHandlePrint
	• – printDocumentView
But I'm really not sure how to use these methods to achieve my printing needs - the documentation doesn't appear to be very useful for understanding this.

The fact that these methods are reading the values rather than having setters, means that I will presumably have to create a subclass of the frame view and use that, but I am loading the document directly using the loadHTMLString which gives me a pre-populated hierarchy and I'm not sure how I would intercept and put my own class in there, if that is what I need to do.

My WebView has a single table in it.

Briefly, my needs are as follows:
- print headers and footers on the page
- print the content at the top of the content area even if it's shorter than the page
- ensure pagination doesn't split table rows

I am quite familiar with the knowsPageRange, rectForPage, etc, so if I can get access to that machinery, I should be all set.

Are there any examples that show how to achieve my needs as outined above, or any other suggestions about accomplishing this)?

Thanks

Gideon






_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Prev by Date: Re: MainMenu.nib won't load - NSDocumentController shared instance - unsanity haxie?
  • Next by Date: Re: Initializing unichar variable with a human readable letter
  • Previous by thread: Re: MainMenu.nib won't load - NSDocumentController shared instance - unsanity haxie?
  • Next by thread: Re: WebView pagination for printing
  • Index(es):
    • Date
    • Thread