0

I have a vector layer of country borders:

enter image description here

I can export it to PDF correctly (Project → Import/Export → Export Map to PDF).

If I then select the "Inverted Polygons" option...

enter image description here

..I get this, which is what I want:

enter image description here

But then if I try to export this to PDF again, I get something messed up:

enter image description here

What's happening? How can I export to PDF correctly with the Inverted Polygons option?

EDIT to answer comments:

(1) QGIS-LTR version when the question was originally posted: 3.22.7 (Białowieża). I then updated my QGIS-LTR version to 3.28.10 (Firenze), but I still get the error. (2) If I export as a raster, I do get the correct result. I would like to export in a non-raster format.

EDIT 2: If I use GforGIS's method, I still get the problem:

EDIT 3: Here is the offending file: https://drive.google.com/file/d/1yvEcOKE1r6nBWCxHn9C4yDJXKsJ4UOeU/view?usp=sharing

enter image description here

Edit 4: I figured it out with the help of GforGIS. The solution is to uncheck a box called "simplify geometries to reduce output file size" in the Advanced section of the "Export to PDF settings":

enter image description here

10
  • I 'm not able to reproduce your problem using latest QGIS version (3.32.2) and default setting for PDF export. Looking at your result it look like you get oversimplified polygon. Could you update your question with your exact QGIS version and PDF export setting ? (you could also check your layer for geometry error as these tend to manifest in unexpected way)
    – J.R
    Aug 24, 2023 at 15:57
  • Also did you try to export as image rather than PDF ? If yes did you get the same result ?
    – J.R
    Aug 24, 2023 at 16:03
  • Try to export it from a print layout instead. It should work.
    – GforGIS
    Aug 25, 2023 at 1:51
  • @J.R I get the problem in QGIS-LTR 3.22.7 (Białowieża), QGIS-LTR 3.28.10 (Firenze), and QGIS 3.32.2 (Lima). If I export to raster, I get the correct result (but I would still like a non-raster export).
    – Pertinax
    Aug 25, 2023 at 19:18
  • Can you share the data?
    – GforGIS
    Aug 26, 2023 at 0:25

1 Answer 1

0

I would create a print layout then export it to PDF, it supports Geospatial PDF as well.That's the method I always use.

enter image description here

enter image description here

Note: When exporting to SVG, make sure you do not select on "Simplfy geometries ..." from the "layout menu", see screenshot below:

enter image description here

1
  • Thanks for trying, but I still get the same problem with your method (see edit to main post).
    – Pertinax
    Aug 25, 2023 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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