Pattern fill incomplete with PDF export and printing

Bug #1437726 reported by Esther
34
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Inkscape
Triaged
Medium
Unassigned

Bug Description

I created an object with a white fill and black stroke. I duplicated it and added a fill to the top object. The saved SVG file retains the fill properly. After exporting the drawing to a PDF, the object's fill is partially missing. Printing the SVG document gives the same result with the object's fill partially missing.

Inkscape version: 0.91
OS: Xubuntu 14.04
Printer HP Officejet 6700
PDF viewer: Document Viewer

=====
Related reports:
Bug #1597955: pattern fill not saved to pdf correctly
Bug #1488129: Pattern not exported to pdf or printed (cairo >= 1.12)
Bug #1462589: When saving to pdf at certain page size, a pattern disappears.
Bug #1441753: Patterns not exporting correctly to PDF
Bug #1437726: Pattern fill incomplete with PDF export and printing
Bug #1390569: SVG fill pattern lost on PDF export

Revision history for this message
Esther (melanes) wrote :
Revision history for this message
Esther (melanes) wrote :

The original SVG file.

Revision history for this message
Esther (melanes) wrote :

Forgot to add the PNG export shows the fill as it should be.

su_v (suv-lp)
tags: added: exporting pattern pdf
Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

It seems that objects whose x and y origin are large are not being included in the pattern as exhibited by the attached simplified SVG file.

Dumping the pattern as a PNG in CairoRenderContext::_createPatternPainter() (cairo_render_context.cpp) shows the proper pattern but examining the content of a PostScript file (PostScript is closely related to PDF but is easier to work with) shows that only part of the pattern contents is present.

Note: The pattern is not rasterized by Cairo. It remains as vector content inside the PostScript or PDF file.

Revision history for this message
Tavmjong Bah (tavmjong-free) wrote :

Bug 1390569 suggests that this could be a Cairo bug introduced between 1.10 and 1.12. The bug doesn't appear in rsvg-convert. However, Inkscape is scaling the pattern up by a factor of 100 in order to better render patterns with non-integer pixel widths or heights. (Cairo requires patterns to have integer width and height.) If I change the scale factor from 100 to 1 (SUBPIX_SCALE in cairo-render-context.cpp) the test pattern renders as expected.

I believe this is a Cairo bug.

Revision history for this message
Shai Efrati (shaief) wrote :

Just for the record: i introduced a workaround that will help users in the mean time:

Use a filter on objects with patterns. This way Inkscape will rasterize them when saving as a PDF.

http://graphicdesign.stackexchange.com/a/60859/6920

su_v (suv-lp)
Changed in inkscape:
importance: Undecided → Medium
status: New → Triaged
description: updated
Revision history for this message
Hans Milos Toquica Cáceres (hmtoquicac) wrote :

Is this bug fixed already? I wouldn't like to use the workaround of applying the filter.

I tried to export it as an eps and convert it to pdf by means of using LaTeX. No good luck either.

Revision history for this message
Hans Milos Toquica Cáceres (hmtoquicac) wrote :
Revision history for this message
Hans Milos Toquica Cáceres (hmtoquicac) wrote :
Revision history for this message
Hans Milos Toquica Cáceres (hmtoquicac) wrote :
Revision history for this message
Hans Milos Toquica Cáceres (hmtoquicac) wrote :

The solution posted by https://launchpad.net/~suv-lp does not entirely works, as for objects created and rotated including a fill patter, the filter won't be applied correctly, this is a couple of reported bugs: Bug #1414214 and Bug #806028.

However a valid solution is making the image really big (hit Ctrl+D and set a custom size), the size that worked for me was 40 times horizontally bigger and 40 times vertically bigger. After saving the file as a pdf, you can use a cropping tool to resize it.

It is advisable to use 'pdfcrop' from the package 'texlive-extra-utils', just enter the command 'pdfcrop file.pdf' and it will provide a file 'file-crop.pdf'. This is in case you want to resize the file to the content (no margins), in case you want margins, please read the help on this package (enter 'pdfcrop --help' in the terminal).

This was confirmed by using Kubuntu 16.04.

Revision history for this message
Hans Milos Toquica Cáceres (hmtoquicac) wrote :

This is the result which is satisfying. For some reason, the Okular reader fails to show the render completely fine, however the other pdf reader show the render in the proper way.

su_v (suv-lp)
description: updated
Revision history for this message
Blake Hannaford (blake-hannaford) wrote :

This bug is still present in Inkscape 0.92.3

Revision history for this message
Albert (sapristi) wrote :

To reiterate that this bug is still present in Inkscape 0.92

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

Remote bug watches

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