'Adobe PDF via poppler-cairo' (trunk): imprecise and incorrect stroke widths

Bug #1017123 reported by su_v
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
theAdib

Bug Description

Importing PDFs via the experimentally enabled 'Adobe PDF via poppler-cairo (*.pdf)' input extension lacks precision and incorrectly adjusts line widths (thin lines default to 1px).

Based on the information [2] provided in a ticket filed for 'pdf2svg' (also based on poppler-cairo) in MacPorts [1] I tried to apply the same changes to Inkscape's import routine based on poppler-cairo, which produces the intentioned improvements for line drawings (but apparently introduces a regression with regard to PDF elements converted into pattern-filled SVG objects [3]).

The proposed patch needs to be reviewed by someone familiar with both poppler and cairo - I haven't tested it extensively with other PDF files, but the problem with bad precision and incorrect line widths can be reproduced both with externally created PDF files as well as with PDF files created by Inkscape (see attached samples).

Tested with current trunk r11512 (unpatched and patched) on OS X 10.7.4,
with poppler 0.18.4 and cairo 1.12.2 installed.

---
[1] <https://trac.macports.org/ticket/32270>

[2] the ticket quotes a conversion on irc with cairo developer Adrian Johnson:
<wagle> if pdf2svg uses poppler, and now draws lines too thick compared to 6-9 months ago, is poppler the one at fault? The lines used to be 0.398 thick, are now 1
<adrianj> wagle: pdf2svg should be calling poppler_page_render_for_printing() instead of poppler_page_render(). The former is for use with cairo vector surfaces. The latter for image surfaces.
<adrianj> The stroke adjust feature will cause lines < 1 wide to be adjusted to 1 pixel wide but only for image surfaces.

[3] See also the files attached in (private) bug #1009438 "Cannot Import Vector PDFs with large number of paths"

Tags: importing pdf
Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
su_v (suv-lp) wrote :

With regard to 'precision': please open the files
- drawing-1-poppler-cairo-pdf-import-unpatched.svg
- drawing-1-poppler-cairo-pdf-import-patched.svg
in Inkscape, zoom in closely to a drawing detail, and compare the paths in outline view mode.

su_v (suv-lp)
description: updated
Revision history for this message
jazzynico (jazzynico) wrote :

Not reproduced on Debian Whezzy (poppler 0.16.7-3, cairo2 1.110.2-7) and Windows XP (devlibs r31).

Revision history for this message
su_v (suv-lp) wrote :

> Not reproduced on Debian Whezzy (poppler 0.16.7-3, cairo2 1.110.2-7)

Confirmed - the issue seems not to be triggered by older poppler / cairo versions:
Not reproduced on Mac OS X 10.5.8 (poppler 0.16.6, cairo 1.10.2) either.

-> depends on upstream changes to poppler-cairo?

Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
su_v (suv-lp) wrote :

Reproduced with Inkscape 0.48+devel r11737 on Ubuntu 12.10 (cairo 1.12.2, poppler 0.20.4)
(patch not yet tested)

Changed in inkscape:
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

> (patch not yet tested)

Works as expected with r11738 on Ubuntu 12.10 (cairo 1.12.2, poppler 0.20.4).

Revision history for this message
su_v (suv-lp) wrote :

Reduced patch which only uses higher precision for the actual page imported into Inkscape, but not for the page preview.

Revision history for this message
theAdib (theadib) wrote :

the patch #13 works for me and makes sense. I tested under Ubuntu 13.10 using cairo 1.12.16, poppler 0.24.1

I will test on windows aas well and the commit.

Adib.

Changed in inkscape:
importance: Undecided → Medium
assignee: nobody → theAdib (theadib)
milestone: none → 0.91
Revision history for this message
theAdib (theadib) wrote :

I can not reproduce the bug on win32 platform using latest build cairo 1.11.2 and poppler 0.12.1. The result always looks good.

However the path looks harmless and the correct way for converting to vector according to the poppler doc.
see
http://cairographics.org/renderpdf/
https://developer.gnome.org/poppler/unstable/PopplerPage.html

I will commit this patch.

Adib.

Revision history for this message
theAdib (theadib) wrote :

fix as of #13 commited in rev 13283

Changed in inkscape:
status: Confirmed → Fix Committed
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.