How to avoid multi-layered PDF's created in InkScape


Question

Given a pdf, is there an easy way to find out whether is has multiple layers? The files I am concerned of are made in InkScape (in which they were multi-layered SVG's) but how can I figure out whether they do still have multiple layers when converted to a PDF? I use File -> Save as -> *.pdf to convert the SVG to a PDF. If they do have multiple layers, what is the 'cheapest' way of flatting a PDF? (I don't want to buy Adobe Acrobat or start another free trial, though I know it is possible there.) The importance of this is that when printing, multiple layers may not all be printed.

1
1
10/7/2014 11:14:00 PM

Accepted Answer

PDF,as SVG files, actually, don have the concept of "layers". In SVG files there are groups of objects - Groups are meant to be more flexible than layers - and what Inkscape calls "Layer" is rather an UX choice - if you check the generated SVG file, you have a group there, not distinguishable, but for specific inkscape metadata, from a group created by joining two primitive paths. Inkscape have separate UI controls to apply attributes such as opacity and combination mode to the layer groups - but the same can be done to objects joined by other methods.

PDF, similarly, deals with arbitrary objects on a page, which can be layered on top of each other with differing combination modes. Thus, there are no "layers". I am not that confident in the internal representation of objects in PDF, but i`d say there are the equivalent to groups - which can have common ordering, opacity and combination attributes.

Therefore - layers in Inkscape are probably preserved as distinct groups of objects inside teh PDF file, even if just in order to simplify the conversion process. Since you are worried about "flattening" - unless you are concerned with someone "disassembling" your pdf page and getting your bitmap resources as they where, you should not be concerned - i.e. - there is no point in getting concerned about multiple layers using more layers or machine resources than a flatted one - all objects are specified as individual objects wether if the "groupping" indicated in Inkscape layers is preserved, or the layer attributes are individually "baked" to each object.

TL;DR: if you are worried about a "multilayered" pdf wasting more resources than a "flattened" one, there is no point to be worried - it is of the nature of vector file formats that objects are specified individually. If on the other hand, you are worried about being possible to get to your individual image resources, the existence of the "layers" is irrelevant all the same. The way out is to export to a PNG file or open the SVG in a raster image program such as GIMP, and re-create the PDF with embedded pixel information, instead of vector objects (which is essentially a PNG file inside the PDF)

2
10/8/2014 3:18:00 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow


Website under construction!!!
^