Can QGIS preserve layers when exporting to PDF?

A short guide on producing a multi layered pdf from Qgis - Mar 2015

https://lists.osgeo.org/pipermail/qgis-user/2015-March/031206.html

Below is a paraphrased version of the link above:

  1. From QGIS composer, save your map as SVG and tick the option "Export map layers as svg groups" when you have pressed save.
  2. Open the SVG file in Scribus open source desktop publishing software.
  3. Use "Window->layers" to open the layers window. Add say 10 empty layers.
  4. Ungroup the layers by right clicking and choose ungroup.
  5. Select features to be in a new layer, right click and choose "Send to layers" and choose one of the created empty layers.
  6. Export the document as PDF, with Include Layers" checked "on".
  7. It is important to export (not save as) to PDF 1.5. The default PDF 1.4 would not let you save as layers. The selection of the ungrouped layers in the SVG layer is a bit cumbersome, if the features spread across the map

This was on the list of possible Google Summer of Code projects 2010 (http://www.qgis.org/wiki/Google_Summer_of_Code_2010#SVG.2FPDF_export_improvements) but I don't think anybody got to work on it.


Found this question when I tried to do this as well, but it was really easy now with QGIS 3.16.

  1. Create a print layout
  2. Select Export as PDF

List item

  1. Select where you want to store the PDF and give the PDF a name.
  2. Enable "Create Geospatial PDF" Geospatial PDF In the layer structure you can select, which layers should initially be visible and got attributes. (You need to ensure that all layers that you want to include are enabled in the QGIS window).