1

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.

  • Have you tried to merge the layers in Inkscape? Or to export as png and convert the export in PDF? – Paolo Gibellini Oct 8 '14 at 5:20
  • Exporting as png gives a loss of quality, but I'll try merging. – user30521 Oct 8 '14 at 6:03
  • Exporting as png gives a loss of quality, but I have succeeded to merge the layers. Are you sure this always gives a one-layer pdf when exporting? (I don't know how to check, see.) – user30521 Oct 8 '14 at 6:14
  • Nice question... I don't know how to check whether the pdf is multi-layered or not (I guess it should be a one-layer file). See here another way: softwarerecs.stackexchange.com/questions/7314/…. Regarding PNG, you can increase the quality of the export by increasing the resolution. All depends on the final use of the PDF document (typography? printer? monitor?). – Paolo Gibellini Oct 8 '14 at 9:47
2

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)

  • I'm not worrying about the size of the pdf or the possibility it of being disassembled by somebody, my main concern is that a digital printer may not recognise the Z-order (e.g.: which one of two objects covers the other one?) giving unexpected results. I expect there to be a method to ignore the objects themselves and only remember what's visible, without losing the infinite sharpness of a vector graphics which for example a png does not have (At least, I don't succeed to get a vector-like png from InkScape.) After all, I'm not sure if I understand well what flatting really is. Thanks anyway. – user30521 Oct 8 '14 at 22:17
  • from PDF v1.5 (2003, Acrobat 6.x), ISO standard has the multi-layer/OCG Optional Content Group: en.wikipedia.org/wiki/… As now only Scribus support well the multi-layer PDF – Valerio Sep 7 '17 at 7:47
0

A) using the open Evince on Windows and Linux you can see if a PDF has layers so: 1) be sure to have the lateral panel (press F9 in case) 2) in the lateral panel drop down box, istead of 'Thumb' select 'Layers' 3) if is grayed out, no layers are present

B) using the free Adobe Reader you can see if a PDF has layers so: 1) go to the page where you are interested in discovering the presence of layers 2) View menù, Navigation layers 3) if there are layers, they are listed. 4) using the two gear icons you can also show the layers present on the current page or all the layers present in the document

Current Inkscape 0.92 while support exporting to PDF 1.5 that has layers, cannot export internal layers to PDF. So exporting to PDF always results in flattening.

A work around can be using Scribus

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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