WebView pagination for printing
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