diff options
author | Federico Mena Quintero <federico@gnome.org> | 2019-05-24 13:06:22 -0500 |
---|---|---|
committer | Albert Astals Cid <tsdgeos@yahoo.es> | 2019-05-27 12:41:56 +0000 |
commit | 970e14c6c9c05b669a512adfce6421a747f54c71 (patch) | |
tree | 59ae47e774ac7294dec98e9ea94157d8fe6d8922 /glib | |
parent | 13eddb110671cb9809fc21558b45db2a775a172b (diff) |
glib: Document the differences between render() and render_for_printing() - #749
I got these by grepping for "printing" in the source code, and trying
to summarize the differences between rendering to the screen and
rendering to a printer. Hopefully these are all the important ones.
Fixes https://gitlab.freedesktop.org/poppler/poppler/issues/749
Diffstat (limited to 'glib')
-rw-r--r-- | glib/poppler-page.cc | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/glib/poppler-page.cc b/glib/poppler-page.cc index dc82afc4..134557e0 100644 --- a/glib/poppler-page.cc +++ b/glib/poppler-page.cc @@ -373,7 +373,9 @@ _poppler_page_render (PopplerPage *page, * Render the page to the given cairo context. This function * is for rendering a page that will be displayed. If you want * to render a page that will be printed use - * poppler_page_render_for_printing() instead + * poppler_page_render_for_printing() instead. Please see the documentation + * for that function for the differences between rendering to the screen and + * rendering to a printer. **/ void poppler_page_render (PopplerPage *page, @@ -393,6 +395,9 @@ poppler_page_render (PopplerPage *page, * Render the page to the given cairo context for printing * with the specified options * + * See the documentation for poppler_page_render_for_printing() for the + * differences between rendering to the screen and rendering to a printer. + * * Since: 0.16 **/ void @@ -410,7 +415,36 @@ poppler_page_render_for_printing_with_options (PopplerPage *page, * @page: the page to render from * @cairo: cairo context to render to * - * Render the page to the given cairo context for printing. + * Render the page to the given cairo context for printing with + * #POPPLER_PRINT_ALL flags selected. If you want a different set of flags, + * use poppler_page_render_for_printing_with_options(). + * + * The difference between poppler_page_render() and this function is that some + * things get rendered differently between screens and printers: + * + * <itemizedlist> + * <listitem> + * PDF annotations get rendered according to their #PopplerAnnotFlag value. + * For example, #POPPLER_ANNOT_FLAG_PRINT refers to whether an annotation + * is printed or not, whereas #POPPLER_ANNOT_FLAG_NO_VIEW refers to whether + * an annotation is invisible when displaying to the screen. + * </listitem> + * <listitem> + * PDF supports "hairlines" of width 0.0, which often get rendered as + * having a width of 1 device pixel. When displaying on a screen, Cairo + * may render such lines wide so that they are hard to see, and Poppler + * makes use of PDF's Stroke Adjust graphics parameter to make the lines + * easier to see. However, when printing, Poppler is able to directly use a + * printer's pixel size instead. + * </listitem> + * <listitem> + * Some advanced features in PDF may require an image to be rasterized + * before sending off to a printer. This may produce raster images which + * exceed Cairo's limits. The "printing" functions will detect this condition + * and try to down-scale the intermediate surfaces as appropriate. + * </listitem> + * </itemizedlist> + * **/ void poppler_page_render_for_printing (PopplerPage *page, |