Matt and Gideon,

Although my solution below is not Cocoa, WebView supports it. So, I can give 
further help off-list if the HTML/CSS subject is not adequate for this list.

Gideon's requirements seem to be very simple and, although WebView's 
capabilities are not comparable to "real" printing, he can use CSS 
(stylesheets):

> - print headers and footers on the page

To repeat the table headers on every page with very simple HTML and CSS changes:

1. The table must have well-defined <thead> and <tbody> sections;

2. In the stylesheet, the thead element should have this property (it's 
standard in most browsers, but it's nice to force it):

        thead {display: table-header-group;}


> - print the content at the top of the content area even if it's shorter than 
> the page

This should be easy if you don't rely on tables for the layout. An 
"absolutely-positioned" div element will auto-adjust its size to the content, 
unless you specify a size for it. But, even if you set a fixed size, the 
vertical-align property is "top" by default (in contrast to table cell, which 
is "middle" by default).

If you can't make sense of this, check w3c.org or consult a skilled web 
designer.


> - ensure pagination doesn't split table rows

This is easy, but I am not sure if WebKit's implementation applies this 
property to table-row elements:

        th, tr {page-break-inside: avoid;}


Cheers,
Flavio Donadio


On 20/07/2010, at 22:38, Matt Neuburg wrote:

> Then I'd suggest that you just write a view of your own that draws the way
> you want, and print that view. Using a Web view to print is a quick
> solution, but you can't beat real printing if what you want is control over
> what's printed. The machinery with which you are familiar gives you that
> control. m.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to