Bug 45505

Summary: FILESAVE: Gradients corrupted on export to PDF
Product: LibreOffice Reporter: Richard Corner <rac9876>
Component: DrawingAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: medium CC: barta, pierre-eric
Version: 3.4.5 release   
Hardware: Other   
OS: All   
Whiteboard: BSA
i915 platform: i915 features:
Attachments: LibreOffice Draw file that can be used to reproduce the problem
PDF file resulting from export, with gradient showing horizontal lines
ODG PDF comparison

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

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.