Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I have a PDF, made with Inkscape, that uses transparent colors. This image shall be used in a LaTeX document.

While preserving the transparency is nice for editing, it can be a problem for printing. Printing usually involves PDF to PS conversion. Since Postscript does not support transparency, this requires either

  • flatting, i.e. creating a vector graphic that works without transparency


  • rastering, i.e. rendering a bitmap image.

When a PDF document containing such a figure is printed (or converted to PS) using Evince (or Cairo or Ghostscript), the whole page gets rendered as a bitmap, rendering fonts ugly (different from other pages). (Adobe Acrobat handles such PDFs well.)

Unfortunately, converting the PDF figures to EPS (before including them with LaTeX) doesn't help much, because both pdftops and pdf2ps (again, Cairo or Ghostscript) rasterize the image, i.e. render a bitmap (saved as EPS). (This is slightly better, because it doesn't affect the whole page, but I'd still prefer a vector graphics.)

How can I flatten transparency with Inkscape or other software on Linux?

share|improve this question
Interesting question. It would be very complex to flatten svg as every possible intersection of shapes would need to create a new opaque shape with composite fill. – artfulrobot Oct 7 '12 at 16:26
@artfulrobot Exactly. The resulting vector graphics can in general become quite complex. However for a number of typically vector line art graphics, the result should still work well on a modern Postscript printer. – Jan Oct 10 '12 at 13:11
The best method I've found is a tedious manual one, involving redrawing after an initial step: use inkscape to convert your pdf to an svg, open the svg in a good text-editor. Replace all occurrences of 'opacity:[0][0-9\.]' with 'opacity:1' (regex version) or find 'opacity:0.' and manually replace with opacity 1 (tedious version). Open the svg in inkscape and make it look nice again (the hard part), than back to pdf and on to eps. – Chris H Jan 27 '14 at 11:30

4 Answers 4

One way around bad rasterization is to manually convert your PDF document to postscript because when you invoke CUPS through evince or whatever gui, it will be converted anyways.

You can try pdftops -r 1200 document.pdf to increase the resolution from the low default of 300, and then print the resulting postscript. However, with the printers at work this did not yield a significant improvement. Regular text on pages with and without transparent images still looked different -- blurry vs. clear.

So I ended up using Acrobat Professional (on a windows machine) to flatten the transparent images used in my latex document, which gave optimal results. Check that Transparency Flattener Preset is at [High Resolution] in the advanced print setup. My colleague mentioned that one could perhaps FTP a pdf file directly to a modern laserjet network printer, bypassing the postscript conversion. I have not tried this.

Would be great to have linux-only solution to this issue.

share|improve this answer

One way is to make a white box in Inkscape the same size as your page and send it to the bottom layer. This will export your image with a white background instead of a transparent one.

share|improve this answer
The problem is not a transparent background and adding a white background does not solve it. The image question uses semi-transparent shapes ontop of other (opaque) shapes. SVG and PDF support this, but PS doesn't. – Jan May 2 '12 at 11:11

I had the same problem and this is my solution (for future reference):

I tried a lot of things, and so far the best working solution that I found on the internet was rendering the PDF completely as an image with pdf2ps and ps2pdf13, but the result wasn't satisfactory for me, because all vector shapes were lost. I wanted to render only the critical parts, but retain the vector graphics.

What did the trick for me was to isolate all critical parts in inkscape and putting them on a separate layer (in my images this was all the shadows). I made only this layer (and the background layer) visible and exported it to PNG, effectively rendering all transparency effects, but only them. I imported it back and used it in a new layer. After flipping all layer visibilities (transparency layer: off, all others: on), the exported PDF worked perfectly with LaTeX and was printable without rendering the whole page as image.


  1. Isolate all problematic transparencies to one layer (transparency masks, shadows, etc.)
  2. Make only the problematic layer & background visible
  3. Export to PNG
  4. Import the just created PNG and use as background
  5. Make all layers visible except the problematic layer
  6. Export to PDF
  7. Smile :)
share|improve this answer
pdftops -origpagesizes input.pdf


ps2pdf -r600x600 input-new.pdf
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.