Bug 45505 - FILESAVE: Gradients corrupted on export to PDF
Summary: FILESAVE: Gradients corrupted on export to PDF
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
3.4.5 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-01 08:59 UTC by Richard Corner
Modified: 2014-01-12 21:05 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
LibreOffice Draw file that can be used to reproduce the problem (10.32 KB, application/vnd.oasis.opendocument.graphics)
2012-02-01 08:59 UTC, Richard Corner
Details
PDF file resulting from export, with gradient showing horizontal lines (5.48 KB, application/pdf)
2012-02-01 09:00 UTC, Richard Corner
Details
ODG PDF comparison (44.37 KB, image/png)
2014-01-12 21:05 UTC, tommy27
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Corner 2012-02-01 08:59:29 UTC
Created attachment 56458 [details]
LibreOffice Draw file that can be used to reproduce the problem

Problem description: 

Steps to reproduce:
1. Create a document with a callout containing a gradient going from dark at the top to light at the bottom.
2. Use File > Export to export to one of the above formats.
3. Open the resulting file in GIMP or another program.

Current behavior:

The gradient when opened in the other program looks messed up, with lots of horizontal lines across it.

Expected behavior:

The gradient when opened in the other program should be smooth, looking like it did in LibreOffice Draw.

Platform (if different from the browser): 

Windows 7 Home 64-bit.
              
Browser: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7
Comment 1 Richard Corner 2012-02-01 09:00:43 UTC
Created attachment 56459 [details]
PDF file resulting from export, with gradient showing horizontal lines
Comment 2 tester8 2012-02-03 05:07:13 UTC
Reproduced with

LibreOffice 3.5.0rc3
7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Ubuntu 10.04.3 x86
Linux 2.6.32-38-generic Russian UI
Comment 3 Michael Meeks 2012-06-14 02:45:31 UTC
I load this gradient in acroread and I see a reasonably linear gradient. Are you sure you're not just seeing rendering artifacts in the viewer ? :-)

It is possible of course that we do some subsetting of gradients inside the VCL rendering rather than writing them out to PDF as gradients, worth digging into:

vcl/source/gdi/pdfwriter.cxx

to see what is going on there.
Comment 4 Pierre-Eric Pelloux-Prayer 2013-09-02 12:47:31 UTC
The issue seems to be on the side of the pdf viewer.

I tested a bunch of document, and Adobe Reader displays gradients just fine when Evince, ImageMagick and pdftocairo fail (visible horizontal lines).

On a side note the function handling gradients in pdfwriter_impl2.cxx (PDFWriterImpl::playMetafile) has 2 ways to draw them and use USE_PDFGRADIENTS constant to decide which implementation to use.

As USE_PDFGRADIENTS is always unset (AFAIK), maybe some cleanup here is necessary ?
Comment 5 Pierre-Eric Pelloux-Prayer 2013-09-23 08:35:46 UTC
@Richard Corner: this problem should be fixed in the next LibreOffice version (at least for linear and axial gradients).

You can also help by testing daily versions (http://dev-builds.libreoffice.org/daily/master/) to make sure your problem is properly fixed.

Thanks!
Comment 6 tommy27 2014-01-12 21:05:40 UTC
Created attachment 91911 [details]
ODG PDF comparison

tested your ODG file with LibO 4.1.4.2 under Win7 64bit and exported it to PDF. output file has smooth gradient like the original. 

see my screenshot.
I mark this as RESOLVED WORKSFORME