dashed line type pdf problem

Bug #215902 reported by Fred M.
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Undecided
Unassigned
libcairo
Fix Released
Medium
inkscape (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

under certain circumstances, dashed lines extend beyond end of segment in pdf but look ok on screen.

Steps to reproduce:

1) Use Bezier/Line Tool to draw "W"
2) Change line type to dashed (I used #18 in select)
3) draw solid circle
3) save as pdf "via Cairo"

line segments render correctly when circle is removed.

This is with 0.46 on ubuntu gutsy.

----------------------------------------

frm@ws1:~/tmp/inkscapebug$ dpkg -l | egrep -e "libcairo|inkscape"
ii inkscape 0.46-0ubuntu2~gutsy1 vector-based drawing program
rc libcairo-java 1.0.3-0ubuntu4 CAIRO bindings for Java
ii libcairo-perl 1.041-1 Perl interface to the Cairo graphics library
ii libcairo2 1.4.10-1ubuntu4.4 The Cairo 2D vector graphics library
ii libcairo2-dev 1.4.10-1ubuntu4.4 Development files for the Cairo 2D graphics
ii libcairomm-1.0-1 1.2.4-2 C++ wrappers for Cairo (shared libraries)

Tags: pdf
Revision history for this message
In , Carl Worth (cworth) wrote :

Sorry we've never replied here.

I just tested this with cairo 1.6.2 and it appears to be working just fine.

That is, with 1.6.2, we don't use fallbacks anymore for the gradients, so the bug is hidden.

I think the bug is likely still present with dashed lines and fallbacks, but it's going to be harder to hit, (since in 1.6 getting fallbacks in cairo-pdf is much harder).

So please upgrade to 1.6 and see if that doesn't fix your problems.

In the meantime, I'll leave this bug open so we can look into the "mis-sized dashing with PDF and fallbacks" issue.

-Carl

Revision history for this message
Fred M. (frm) wrote :

under certain circumstances, dashed lines extend beyond end of segment in pdf but look ok on screen.

Steps to reproduce:

1) Use Bezier/Line Tool to draw "W"
2) Change line type to dashed (I used #18 in select)
3) draw solid circle
3) save as pdf "via Cairo"

line segments render correctly when circle is removed.

This is with 0.46 on ubuntu gutsy.

----------------------------------------

frm@ws1:~/tmp/inkscapebug$ dpkg -l | egrep -e "libcairo|inkscape"
ii inkscape 0.46-0ubuntu2~gutsy1 vector-based drawing program
rc libcairo-java 1.0.3-0ubuntu4 CAIRO bindings for Java
ii libcairo-perl 1.041-1 Perl interface to the Cairo graphics library
ii libcairo2 1.4.10-1ubuntu4.4 The Cairo 2D vector graphics library
ii libcairo2-dev 1.4.10-1ubuntu4.4 Development files for the Cairo 2D graphics
ii libcairomm-1.0-1 1.2.4-2 C++ wrappers for Cairo (shared libraries)

Revision history for this message
Fred M. (frm) wrote :
Revision history for this message
Aaron C Spike (acspike) wrote :

Likely cairo bug:
https://bugs.freedesktop.org/show_bug.cgi?id=9189

We saw this when we originally started testing Cairo PDF export. Caused when the rasterizer gets used.

Revision history for this message
Aaron C Spike (acspike) wrote :

Carl Worth of Cairo reports that this bug won't likely be experienced with Cairo 1.6.x because of improvements to the PDF support. (The underlying issue may still be there.)

Revision history for this message
Fred M. (frm) wrote : Re: [Bug 215902] Re: dashed line type pdf problem

I just noticed that the inkscape release notes for v 0.46 says libcairo
1.52 should be considered a minimum for "quality pdf export". I'll
update this bug report when I get a chance to compile and try libcairo 1.6.

--Fred

Aaron Spike wrote:
> Carl Worth of Cairo reports that this bug won't likely be experienced
> with Cairo 1.6.x because of improvements to the PDF support. (The
> underlying issue may still be there.)
>
>

--
==========================================================
Fred R. McDavid, III
  540-248-2419
    <email address hidden>
==========================================================

Revision history for this message
Fred M. (frm) wrote :

I compiled libcairo 1.6.4, put the libcairo and libpixman in LD_PRELOAD, and inkscape PDF and this issue went away. This bug is an ubuntu gutsy problem, not an inkscape problem.

Revision history for this message
Tom Davidson (tjd-mit) wrote :

Marking fix released per discussion comments

Changed in inkscape:
status: New → Fix Released
Revision history for this message
Tim Holy (holy-wustl) wrote :

PDF export still has problems in inkscape with current Hardy, at least when it comes to transparency. See my comments in the following bug report:
https://bugs.launchpad.net/inkscape/+bug/181789
(The bug is currently marked "Fix released," at least as far as inkscape is concerned, but I still have problems.)

Note this is with cairo 1.6.0.

Revision history for this message
Ketil Malde (ketil-ii) wrote :

I see exactly this behavior (as described by the initial poster) with current Inkscape/Cairo from Hardy.
More specifically:

  - print or save as PDF/PS via Cairo makes dashed lines unbounded at one end
  - print via the print preview fails to render (some?) transparent objects at all
  - save as (non-cairo) PS makes transparent objects solid

(In the end, I replaced all my dashed lines with solid ones, and used Cairo)

ii libcairo2 1.6.0-0ubuntu1 The Cairo 2D vector graphics library
ii inkscape 0.46-0ubuntu2 vector-based drawing program

-k

Changed in libcairo:
status: Unknown → Confirmed
Revision history for this message
In , Chris Wilson (ickle) wrote :

*** Bug 17223 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Chris Wilson (ickle) wrote :

*** Bug 13411 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Paul-inet (paul-inet) wrote :

This may a duplicate of bug 17723, but it's not at all "hidden". I see Carl Worth says he tested the code in this bug report, and it "is working". My problem, on the other hand is not noticeably absent.

It's quite easy to replicate- especially with printer surfaces. Bug 17723 lists a 2-liner patch to fallback_resolution.c which demonstrates exactly how easy it is; simply set the line style to dashed lines instead of solid lines in that example, and voila- an instant mess.

In fact in my opinion it's impossible to draw dashed lines to a printer context without this problem occurring, unless you set the fallback resolution of the surface to match the physical device resolution.

That means that for some win32 printers, the fallback resolution must be set to 1200x600 [inefficient], where for PDF and postscript, the fallback resolution must be set to 72x72 [insufficient]. Besides the fact that anything at 72x72 resolution looks like rubbish, the PDF/Postscript result is inconsistent with win32 output.

Of course, since there is a single fallback resolution for the whole surface, the inconsistency does not just apply to dashed lines; If you adjust the fallback resolution to something nonsensical like 72x72 just to get the dashed lines working, the whole graphic is rendered in that resolution- not just dashed lines.

This is a major problem when producing output for printers where the graphic contains dashes.

If anyone has any work-arounds in the interim, I would be most grateful.

Revision history for this message
In , Chris Wilson (ickle) wrote :

(In reply to comment #4)
> This may a duplicate of bug 17723, but it's not at all "hidden". I see Carl
> Worth says he tested the code in this bug report, and it "is working". My
> problem, on the other hand is not noticeably absent.

Indeed and the bug is now dutifully reported by the test suite and I've used your report as an example of how it still exists within cairo-win32-printing and affects users. So since it is now painfully obvious that cairo is broken, I hope to see a fix soon.

Revision history for this message
In , Paul-inet (paul-inet) wrote :

Is there anything I can do to help fix the problem? I did try digging into the code, but I am afraid it's rather above me. Perhaps with some pointers as to where to look, or some hand-holding, I could do some of the drudge work?

Revision history for this message
In , Chris Wilson (ickle) wrote :

(In reply to comment #6)
> Is there anything I can do to help fix the problem? I did try digging into the
> code, but I am afraid it's rather above me. Perhaps with some pointers as to
> where to look, or some hand-holding, I could do some of the drudge work?

Well, we know the problem is stroking dashes under a fallback image so the issue is likely to be confined to _cairo_stroker_line_to_dashed() in src/cairo-path-stroke.c (and its inputs). If you are interested, I'd read through that function taking note of what matrices are used and then tracing back to see their construction. Then either you spot the problem straight-away, or you can start comparing the difference between difference fallback resolutions. If you can join us on irc, in #cairo on irc.freenode.net, we'll happily help you learn the code and assist in whatever way we can.

Revision history for this message
In , Paul-inet (paul-inet) wrote :

Thanks- I'll get out my spade and go digging. I will let you know what I find.

Revision history for this message
In , Adrian Johnson (ajohnson-redneon) wrote :
Changed in libcairo:
status: Confirmed → Fix Released
Revision history for this message
Bryce Harrington (bryce) wrote :

We've got cairo 1.8 for Jaunty, so I assume this bug is fixed. If not, feel free to reopen.

     cairo | 1.8.6-1ubuntu2 | http://archive.ubuntu.com jaunty/main Sources

Changed in inkscape (Ubuntu):
status: New → Fix Released
tags: added: pdf
Changed in libcairo:
importance: Unknown → Medium
Changed in libcairo:
importance: Medium → Unknown
Changed in libcairo:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

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