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.
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
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.