Comment #12 on issue 9847 by [email protected]: Implement printing
http://code.google.com/p/chromium/issues/detail?id=9847

I just went through above CL and printing related code and have some  
comments about
how to implement printing on Linux:
IMHO, using GtkPrintOperation/GtkPrintContext classes (since gtk 2.10) to  
implement
printing::PrintingContext would be the preferred and simplest approach on  
Linux.
GtkPrintOperation handles things like print settings UI and provides  
GtkPrintContext
object for client app to print on it. GtkPrintContext provides a cairo  
context for
client app, so that page content can be drawn on it using cairo functions.
Now the problem is, we can only print(draw) content onto a cairo context  
with
operations and data formats that cairo supports. So renderer should convert  
page
content into something that cairo recognizes, instead of pdf, which  
obviously can't
be drawn onto a cairo context without introducing a pdf parser (like  
libpoppler).

With this assumption, the possible solutions for renderer would be:
1. Print page content into a RGB image so that it can be drawn directly onto
GtkPrintContext's cairo context.
2. Record cairo operations with a meta format and then replay them onto
GtkPrintContext's cairo context. CairoScript introduced since cairo 1.9.2  
would be a
perfect solution, but unfortunately it's not stable yet.

For now, I'd suggest to use approach 1. We may implement approach 2 when  
CairoScript
is stable enough.

Regards
James Su

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---

Reply via email to