QGIS to Illustrator post processing

Introduction

As you’re reading this article, you probably already know how easy it is to transfer your QGIS map layouts into Adobe Illustrator for advanced design editing. QGIS provides a direct export option to SVG that preserves all vector information. Once exported, the SVG file can be easily opened in Adobe Illustrator, allowing for further editing and refinement. This seamless workflow ensures that the high-quality cartographic designs created in QGIS can be enhanced and utilized in professional graphic design projects.

The process is straightforward, simply export your QGIS layout as an SVG (Scalable Vector Graphics) file. SVG is a flexible, editable vector format that Illustrator handles well, preserving the visual ordering and appearance of your map layers.


figure 1: QGIS SVG export dialog

With just a few clicks, you can move your vector maps from QGIS into Illustrator, where you can easily customize colors, fonts, and other design elements. However, there are some downsides to this workflow. For instance, layers are converted into groups, legends aren’t translated into sublayers, and nearly all objects are placed inside groups.

1. Layer Grouping Complexity
One of the major challenges is how QGIS handles layers during the export process. The SVG file format does not support layers. When exporting as SVG, all layers in the QGIS map are converted into groups. This results in Illustrator creating a large number of group objects, which can make the document difficult to navigate and edit efficiently. QGIS layers will end up in Illustrator into groupings, requiring time-consuming reorganization and cleanup.

2. Lack of Sub-layer Conversion for Legends
Another limitation is the improper conversion of map legends into Illustrator sublayers. QGIS legends, which are essential for understanding the map, don’t transfer neatly into Illustrator’s layer structure. Instead of becoming editable sublayers, the legend elements are often flattened or grouped, making it harder to adjust them individually.

As mentioned earlier, cleaning up and reorganizing the imported QGIS document in Illustrator can be time-consuming and can been seen as a tedious and boring task. To help streamline this process, we’ve developed a QGIS svg Post-Processing Script for Adobe Illustrator.


figure 2: Illustrator QGIS post processing script dialog

This script automates the cleanup of the imported QGIS SVG document by handling the following steps:

  • Converts the document to CMYK color space;
  • Releases and removes clipping masks;
  • Converts the first level of groups (which contain QGIS layer names) back into Illustrator layers and sublayers;
  • Ungroups all other groups into separate objects;
  • Removes path objects with no color assigned to both stroke and fill;
  • Sorts and moves objects into sublayers based on stroke or fill color;
  • Purges the document of any empty groups, layers, etc.

The only step this script cannot automate is renaming the legend sublayers correctly, as there’s no way to retrieve the original QGIS legend item description. Instead, the script names legend sublayers based on the fill or stroke color of the objects they contain, such as Fill CMYK(0%, 99%, 80%, 0%) or Stroke CMYK(0%, 99%, 80%, 0%). After running the script, you can manually rename the legend sublayers to match the original QGIS legend item descriptions, if needed.

Tip: Include a QGIS legend in your map export. This makes renaming the legend sublayers much easier. In Illustrator, you can simply select a legend item and check the Illustrator Layers panel to see which layer the selected object belongs to, allowing you to rename it accordingly.

How to use this script

Download the script using the link below. Since the script is provided as a zip archive, you’ll need to unzip it before use. Once unzipped, look for a file named QGISsvgPostProcessing v1.19.jsx.

To use the script, first import your QGIS-exported SVG document into Adobe Illustrator. Then, drag the downloaded script file into Illustrator. A dialog box will appear once you release the mouse. You can select which of the seven stages you’d like to process. We recommend selecting all seven by checking all the boxes.

Finally, press the Process *.svg Document button. Please note that processing large map documents may take quite some time, so be patient and keep an eye on the script progress bar for updates.

To exit the script click the Cancel or Exit button.

 

Support Our Scripts!

If you love using our scripts, consider making a small donation to help us keep them running smoothly. Maintaining these scripts and covering server costs isn’t free, and your support makes a big difference. Every little bit helps us continue creating, updating, and improving these tools for everyone. Thank you for being part of our community!

 
If you wish to make a donation, simply click on the “Donate with PayPal” button. You don’t need to have a PayPal account, you can use any debit or credit card when you select debit or credit card as payment method.

 

Download

Post process QGIS *.svg documents into Adobe Illustrator

Version: 1.19
License: Creative Commons – Attribution – Non Commercial – No Derivatives 4.0 International
Document format: ZIP archive
File size: 7.84 KB
Downloads: 400
Platform: Illustrator CS4 or higher, both Windows and macOS
Rating:
Download: QGISsvgPostProcessing v1.19.jsx.zip

 

Share Your Experience!

Have you used our scripts to export your QGIS drawing into Illustrator? We hope they made your work easier and more efficient! We’d love to hear your feedback. What did you enjoy and what can we improve? Your insights are invaluable to us. Please share your thoughts in the comments below!

Leave a Reply

Your email address will not be published. Required fields are marked *