Bug 9190 - [PATCH] Cairo transform matrix reset in poppler_page_render
Summary: [PATCH] Cairo transform matrix reset in poppler_page_render
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: cairo backend (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: high major
Assignee: poppler-bugs
QA Contact:
URL: http://code.magicprints.com/poppler-r...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-28 18:21 UTC by Daniel Colascione
Modified: 2006-12-11 21:24 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Daniel Colascione 2006-11-28 18:21:06 UTC
cairo_scale and other cairo transformation functions have no effect on a
subsequent call to poppler_render_page, since the Cairo backend sets the
transform matrix instead of adding to it. Since poppler_render_page doesn't take
a scaling parameter, it is impossible to use it to render a PDF at anything
other than 72 DPI.

The simple referenced patch(in the URL field) makes CairoOutputDev not reset the
transform matrix, so
cairo_scale(cairo, dpi_x / 72.0, dpi_y / 72.0); poppler_page_render(...) will do
the correct thing.
Comment 1 Kouhei Sutou 2006-12-10 06:25:19 UTC
I want poppler to accept the patch too.

I want to make a PDF file which includes thumbnail image for each page of
original PDF. To do the thing, I wrote the following code:

columns = 3;
rows = 2;

for (i = 0; i < poppler_document_get_n_pages(doc); i ++) {
  cairo_save(cr);
  column = i % columns;
  row = i / columns;
  x = (width / columns) * column;
  y = (height / rows) * row;
  cairo_translate(x, y);
  cairo_scale(cr, 1.0 / columns, 1.0 / rows);
  poppler_page_render(poppler_document_get_page(doc, i), cr);
  cairo_restore(cr);
}

I wrote a patch and started to find similar bug. And I found this bug and filed
patch was same as mine.

I'm happy if the patch is applied.f
Comment 2 Jeff Muizelaar 2006-12-11 21:24:38 UTC
Thanks for the patch.
Fixed in cvs.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.