Summary: | [GTK] Printing support | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alp Toker <alp> | ||||||||||||
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> | ||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||
Severity: | Normal | CC: | christian, cosimoc | ||||||||||||
Priority: | P2 | Keywords: | Cairo, Gtk | ||||||||||||
Version: | 523.x (Safari 3) | ||||||||||||||
Hardware: | All | ||||||||||||||
OS: | All | ||||||||||||||
Attachments: |
|
Description
Alp Toker
2007-10-20 07:32:11 PDT
Created attachment 17396 [details]
Initial printing support, WIP
This is the start of printing support.
It adds one public entry point, webkit_frame_print(), and also adds support for launching print jobs from within pages.
You need a recent version of Cairo to get high-quality PDF output with selectable text and vector graphics -- older versions rasterize the entire document.
Still TODO:
Calculate page rects. Add support for more than just the first page.
Disable font hinting when in print mode. This problem needs to be dealt with for features like text scaling in other places too.
API: Decide whether webkit_frame_print() is correct -- I just made it up. Do we want a function on WebKitPage as well/instead? Do we want this to be overridable in subclasses? Thoughts welcome.
Created attachment 17448 [details]
Nearly feature complete
This revision of the patch now paginates correctly.
Questions arising:
What should the public API look like? Should it be on WebKitPage, WebKitFrame or both?
There is an ugly global that needs to go before the patch is ready.
(I won't be looking into header/footer support.)
Created attachment 17452 [details]
Abstracted PrintContext class
Still has mix 'n' match coding style because I can't bear the look of "gpointer userData".
Not finished yet.
Created attachment 17453 [details]
Print button for GtkLauncher
Please surround printing code with #if GTK_CHECK_VERSION(2, 10, 0). At some point it would be nice to allow for manual page setup from a client app, but this can go in a separate bug once this one is done. Created attachment 17862 [details]
Add printing support
It's a shame to leave this patch in the bug tracker, it works really well.
Coding style is intentionally not consistent wrt. camelCase vs. under_score since I expect the the print spooler will be split out and maybe even shared with other ports in the near future.
No public API change.
Comment on attachment 17862 [details]
Add printing support
r=holger
|