Blue gradient title card with the text "Fedora Design Team Inkcsape Automation Tutorial" with the Inkscape mountain logo

How to automate graphics production with Inkscape

I recorded a 15-minute long tutorial demonstrating how to automate the production of graphics from a CSV file or spreadsheet (basically a mailmerge type deal for graphics) in Inkscape, using the Next Generator Inkscape extension from Maren Hachmann.You can watch it below embedded from the Fedora Design Team Linux Rocks PeerTube channel, or on YouTube. (PeerTube is open source so I prefer it!)

Below I will provide some context for how this tutorial is useful / what you can use it for, and a very high-level summary of the content in the video in case you’d rather skim text and not watch a video. (We’ve all been there 🙂 )

 

Conference Talk Card Graphics

The background on this tutorial is that each Flock / Nest, we need a graphic for each talk for the online platform we use to host the virtual conference. There’s usually on the order of 50+ talks for large events like this, and that’s a lot of graphics to produce manually.

With this tutorial, you will learn how to make a template like this in Inkscape:

Screenshot of a slide in Inkscape showing text with %VAR_VariableName% text in it: %VAR_TalkName%, %VAR_ConferenceName%, and %VAR_PresenterNames%

And a CSV file like this:

ConferenceName TalkName PresenterNames
BestCon The Pandas Are Marching Beefy D. Miracle
Fedora Nest Why Fedora is the Best Linux Colúr and Badger
BambooFest 2022 Bamboo Tastes Better with Fedora Panda
AwesomeCon The Best Talk You Ever Heard Dr. Ver E. Awesome

And combine them to generate one graphic per row in the CSV, like so:

Example output slide that looks similar to the template but there is no %VAR_ text. Instead, at the top it says "BambooFest 2022", it has a talk title of "Bamboo Tastes Better with Fedora", and a speaker name is listed as "Panda"

Conference graphics is a good example of how you can apply this tutorial. You could also use it to generate business cards (it can output PDF!), personalized birthday invitations or personalized graphics for students in your classroom (eg. student name cards for their desks), or signage for your office (use a CSV with the different conference room names.) You can use it to create graphics for labeling items too, like the many boxes in my attic that are labeled poorly in my Sharpie scrawl (LOL.) You could even use it to create awesome banners and graphics for Fedora as a member of the Fedora Design Team!! 😉 There’s a ton of possibilities for how you can apply this technique, so let your imagination soar.

The Inkscape Next Generator Extension

The first step to creating these is to install the Next Generator extension for Inkscape created by Maren Hachmann:

  1. Grab the .inx and .py files from the top level of the repo, download them [next_gen.inx] [next_gen.py].
  2. Then go into the Edit > Preferences > System dialog in Inkscape, search for the “User Extensions” directory listing and click the “Open” icon next to it. Drag the .inx and .py files into that folder.
  3. Close all open Inkscape windows, and restart Inkscape. The new extension will be under the “Extensions” menu:  Extensions > Export > Next Generator.

Creating the Template

Each header of your CSV file (in my example: ConferenceName, TalkName, PresenterNames) is a variable you can place in an Inkscape file that will serve as your template. Take a look at the example SVG template file for direction. To have the TalkName appear in your template, create a text object in Inkscape and put the following content into it:

%VAR_TalkName%

When you run the extension, the %VAR_TalkName%  text will be replaced with the TalkName listed for each row of the CSV. So for the first row, %VAR_TalkName% will be replaced with the text The Pandas Are Marching for the first graphic. For the second graphic, the TalkName will be Why Fedora is the Best Linux. So on and so forth down the TalkName column per each graphic.

Running the Generator

Once your template is ready, you simply run the Next Generator extension by loading your CSV into it, selecting which variables (header names) you want to use in each file name, and hitting the “Apply” button.

More advanced usage of this extension includes changing colors and graphics included in each file. I might cover that in another tutorial if folks would like that.

Tutorial Resources

All of the example files used in this tutorial are available here:
https://gitlab.com/fedora/design/team/tutorials/inkscape-automation

Link to the Next Generator extension:
https://gitlab.com/Moini/nextgenerator

Direct Links to download *.inx and *.py for the extension:

Enjoy!!

3 Comments

  1. […] article was originally published on the author’s blog and has been republished with […]

  2. […] I recorded a 15-minute tutorial with supporting materials on how to automate graphics production in Inkscape. I demonstrated this […]

  3. PaulN says:

    Thank you for your contribution/posts. I have made use of your material @ https://inkscape.org/forums/questions/command-line-text-search-find-replace/?c=57293#c57293

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.