PDF export fails on simple gradient - PNG does not

Bug #1037956 reported by glathoud
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Medium
Unassigned

Bug Description

When exporting case.svg to case_exported.pdf, the gradient part is wrongly cut on its right side.

But:
 * no problem when exporting the very same case.svg to case_exported.png.
 * no problem when exporting a very similar case_without_issue.svg to PDF.

Note: the gradient has spreadMethod="pad" which does not match the existing bug reports I found. This why I wrote a new bug report.

Attachements:

 * buggy use case:
      case.svg (ok in Inkscape GUI)
      case_exported.pdf (wrong: gradient appears wrongly clipped in Acrobat)
      case_exported.png (ok)

 * very similar use case without bug (bigger viewport)
      case_without_issue.svg
      case_without_issue.pdf

Revision history for this message
glathoud (glathoud) wrote :
Revision history for this message
glathoud (glathoud) wrote :
Revision history for this message
glathoud (glathoud) wrote :
Revision history for this message
glathoud (glathoud) wrote :
Revision history for this message
glathoud (glathoud) wrote :
Revision history for this message
glathoud (glathoud) wrote :

...but by the way, thanks for the great work! We're using it for the production of many many icons...

description: updated
Revision history for this message
Alvin Penner (apenner) wrote :

confirmed on Windows XP, Inkscape bzr rev 11604

Changed in inkscape:
status: New → Confirmed
Revision history for this message
Alvin Penner (apenner) wrote :

just writing to comment that the structure of these files is somewhat unusual, with three separate <svg> tags enclosed within a fourth <svg> tag.
- was there any specific reason why this structure was used?
- was this created by Inkscape?

su_v (suv-lp)
tags: added: exporting gradient pdf
Changed in inkscape:
importance: Undecided → Medium
su_v (suv-lp)
tags: added: masking
Revision history for this message
glathoud (glathoud) wrote :

Thanks for the quick answer.

> just writing to comment that the structure of these files is somewhat unusual, with three separate <svg> tags enclosed within a fourth <svg> tag.
> - was there any specific reason why this structure was used?
> - was this created by Inkscape?

The individual parts are produced by Inkscape, but then grouped using our own program that reads SVG files, groups them and writes out a single SVG file (e.g. case.svg).

The background is: we need to produce many different configurations of similar icons, which share some common parts and differ in others. This has to run automatically.

In details:

 - for each part, our designers give one .ai or .pdf file (e.g. gloss is in one file, marker shape in another file).

 - for a given configuration, the parts that are needed are transformed to SVG using Inkscape's command line.

 - our program then groups the various SVGs together, optionally wrapping each SVG with some transformations (translate, scale) to place each part as desired. The Python program prevents id collisions, changing ids as needed.

 - the program wraps the resulting list of nodes in a single top-level SVG node, with appropriate width and height. Result: one file, e.g. case.svg or case_without_issue.svg .

 - The resulting SVG file is transformed into PNG & PDF versions (for web and print, respectively).

I hope this helps.

Revision history for this message
Bertrand G (berteh) wrote :

confirmed in 0.38.3.1 r9886 on ubuntu quantal.
I managed to isolate some issues (in attached file). hope it helps.

export to png is flawless (for web)
export to pdf does not show the (gradient + masked) background (for print)

attached gradients.svg for simple tests, the portion of gradient showing is directly dependent from the position of the handles of the gradient editor... seems like the gradient does not extend beyond that position, maybe.

any possibility to raise the importance? I think many people use pdf export for publishing/printing... and gradients are a must if you want any decent-looking material.

Revision history for this message
Bertrand G (berteh) wrote :

export (via file>saveas) of the above inkscape file to pdf.

parts in red/pink should not show at all, they are hidden by gradients.

Revision history for this message
Bertrand G (berteh) wrote :

and in the end I want this file to render well... wich for now does not work. (sorry could not isolate the issue... but it sure looks the same as for the file above.

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

@Bertrand Grégoire - your issue AFAICT is different, and related to cairo, not inkscape itself, already tracked for Inkscape in
- Bug #985206 “PDF output different than SVG source (cairo >= 1.11.2)”
  <https://bugs.launchpad.net/inkscape/+bug/985206>

Attaching PDF exported on OS X 10.7.4 with
- Inkscape 0.48.4 and cairo 1.12.2 (partially missing gradients), and
- Inkscape 0.48.4 with cairo 1.12.10 (looks ok compared to SVG as displayde in Inkscape)

(The PDF you attached was also created with cairo 1.12.2)

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

@Bertrand Grégoire - besides the gradient issues with certain cairo versions, the file 'flyer.svg' has additional issues when exporting to PDF: the filter effect 'Invert' applied to the group used as mask is not applied when exporting to PDF (see also comment #3 in bug #808898). The workaround to mask with a bitmap copy of the filtered group did produce visually similar results in the PDF though.

Revision history for this message
launchpaduser (spam5me) wrote :

Perhaps the following helps on the road to nail the issue down. Otherwise it might be a workaround:

I am using Inkscape 0.48.3.1 on Debian Wheezy facing the problem described here. However, in my case it turned out that the figure is not wrongly cut if drawn "sufficiently small" when being created. Rescaling it to a larger size does not yield the bug. But if I create the figure with the large size from the outset it gets affected by the wrong cuts.

Revision history for this message
Beluga (buovjaga) wrote :

Still repro.

Arch Linux 64-bit, KDE Plasma 5
Inkscape 0.92+devel 15099 (GTK3)

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.