Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How do I need to change the transparent objects in an inkscape file to be able to export them correctly to pdf? So far it seems the defaults render the transparent objects either invisible or opaque.

share|improve this question
3  
Exporting transparency used to be a problem in general, and with PostScript in particular, but from what I've read the transparency support with PDF should be working OK nowadays. The changelog for Inkscape 0.47 says that PDF export supports vector transparency, and that version was released in 2009. Make sure you have a somewhat recent version of Inkscape (and libcairo), and make sure your PDF reader supports transparency. In any case, the fallback for the cases where Inkscape can't export transparency "should" be rasterization of the effect, but I know I've battled with the same thing once. –  Daniel Andersson Feb 12 '13 at 19:05

2 Answers 2

Check that it is not rather your PDF reader that is unable to render transparency. Use Adobe Acrobat or Okular (linux), these can render most of the type of transparencies in my experience (including gradients).

The easy silly solution is to export bitmap, then the transparencies over solid objects are rendered. You can then convert to PDF, but this is not scalable anymore.

However, to the best of my knowledge, there is no automatic "robust" way of exporting a scalable PDF with transparencies from inkscape.

You can do it manually though:

  1. export a bitmap and open it in e.g. GIMP
  2. for any transparent solid colour object, duplicate it as many times as it overlays other objects, intersect each of these bits (Ctrl+*) with a duplicate of the overlaid object, and give the intersection the colour you obtain with the pipette in GIMP for this part of your drawing.

A little of a hassle, isn't it? It should be scriptable... See my post at inkscape forum: http://www.inkscapeforum.com/viewtopic.php?f=28&t=15739&e=0

EDIT: OK, thinking a little more of the problem, there's a better way:

  1. create a layer "Transparent" at the depth of the transparent objects, move transparent objects to this layer;

  2. view only this layer and "export bitmap", export the whole page as PNG for easy alignment or a subset if the page is very large;

  3. create a new layer "Bitmap" next to the layer "Transparent", import the PNG you've just saved.

  4. In the doc properties, note the size of the page, and then scale the bitmap (Object>Transform) to match this size exactly.

  5. Ctrl+Shift+A and align object vertically and horizontally with page.

  6. Turn off the viewing of layer transparent and on the layer bitmap before exporting your PDF.

This way, you have a combined Bitmap+Scalable Vector document: only the tranparent fill is not scalable, but it will be rendered correctly in PDF viewers.

Limitations:

  1. You need to repeat this operation each time you modify any of your transparent objects.

  2. You also need to repeat this if you have transparent objects at different depths.

  3. There may be PDF viewers not even handling bitmap tranparency, in which case vector elements in layers below the "Bitmap" layer may not be rendered properly.

share|improve this answer

Since exporting transparent shapes into PDFs still doesn't work properly (at least for me, right now) and the exporting of Bitmaps is (as far as I can tell) a lot of work when you're updating your figure a lot, here's my simple workaround for shapes.

Again, this only works for shapes, not embedded images.

http://www.inkscapeforum.com/viewtopic.php?f=28&t=15739&p=65180#p65180

Basically, it boils down to setting the alpha channel of the color instead of it's opacity. I would have thought these are the same property, but apparently they are not.

Cheers, Jan

share|improve this answer

Your Answer

 
discard

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.