countersheets extension (counters, cards, mail merge from CSV)

Other sites and resources for Inkscape users.
pelle
Posts: 50
Joined: Wed Mar 05, 2008 8:23 am

countersheets extension (counters, cards, mail merge from CSV)

Postby pelle » Sun Jul 22, 2018 10:16 pm

Just tagged my now over 10 years old countersheets extension as version 2.1. Draw templates as groups in Inkscape, then read data from a CSV file and you get new layers with sheets of "counters" (or whatever it is that you want to do; it is kind of a generic mail-merge tool really, but it has some special features like the registration marks that were made to make nice printed single or double-sided sheets of cardboard tokens for playing boardgames, or to make sheets of playing cards, but you could of course do sheets of anything else as well and the name of this extension should probably change at some point...).

https://github.com/lifelike/countershee ... es/tag/2.1

Some changes since 2.0.2:
- bleed
- inline images in text
- sheet backgrounds
- simple text styles (bold and italics)
- import text from external text files (instead of having everything in the spreadsheet)
- outline registration mark rectangles
- registration marks optionally going all the way across sheets
- one-sided sheets option (both front and back on the same sheet)
- dimensions with units in dialog entry fields
- many bug fixes

See the wiki for installation instructions and full changelog and some tutorials etc: https://github.com/lifelike/countersheetsextension/wiki

Moini
Posts: 2853
Joined: Mon Oct 05, 2015 10:44 am

Re: countersheets extension (counters, cards, mail merge from CSV)

Postby Moini » Mon Jul 23, 2018 12:09 am

Can you post a link to your extension into the gallery at inkscape.org? See https://inkscape.org/en/develop/extensi ... -extension for instructions.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

Moini
Posts: 2853
Joined: Mon Oct 05, 2015 10:44 am

Re: countersheets extension (counters, cards, mail merge from CSV)

Postby Moini » Mon Jul 23, 2018 12:11 am

... what is a mail merger, btw.? (and what is a countersheet?)

Is this similar to the Generator extension? http://wiki.inkscape.org/wiki/index.php ... #Generator
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

Moini
Posts: 2853
Joined: Mon Oct 05, 2015 10:44 am

Re: countersheets extension (counters, cards, mail merge from CSV)

Postby Moini » Mon Jul 23, 2018 12:13 am

See, I think this is really useful for a lot of purposes, but I don't really get what exactly it does, because of the terminology you are using. Maybe giving some examples and phrasing it in a way that non-developers can understand would help users looking for something like this a bit.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

pelle
Posts: 50
Joined: Wed Mar 05, 2008 8:23 am

Re: countersheets extension (counters, cards, mail merge from CSV)

Postby pelle » Mon Jul 23, 2018 7:33 pm

It is not so much technical terminology as boardgames terminology. :)

You draw something in Inkscape, and then you want to make many copies of it in the same document, but each copy has to be slightly different (texts modified or colors changed or really any SVG attributes modified) and possibly you might want to arrange the copies in very specific ways instead of just one big rectangle full of copies. So you open excel or your other favourite spreadsheet application and type in all the information about what copies you need and what is special about each copy (the text and colors etc) and then you use this extension to put everything together.

The extension was originally made just for making sheets of this kind of counter:
https://en.wikipedia.org/wiki/Counter_(board_wargames)

Then I and others started using it also to make cards for card games. Some have used it for other things as well.

Only later did I learn that what it does is essentially what office applications call "mail merge". Microsoft has written an introduction about it here (first hit on google): https://support.office.com/en-us/articl ... 948fa3d7d3

Many desktop publishing and office applications have a feature like that. Adobe calls it Data Merge:
https://helpx.adobe.com/indesign/using/data-merge.html

pelle
Posts: 50
Joined: Wed Mar 05, 2008 8:23 am

Re: countersheets extension (counters, cards, mail merge from CSV)

Postby pelle » Mon Jul 23, 2018 8:27 pm

Moini wrote:Is this similar to the Generator extension? http://wiki.inkscape.org/wiki/index.php ... #Generator


Yes! The idea is fundamentally the same. I think I was in contact with the guy making that extension some time in the past. I do not know if the generator collates the things it generates into sheets or just output one file for each thing?

A big difference between my extension and traditional mail/data merge tools like Generator is that the entire input drawing (SVG) is not used as one big template. Instead you can have one or as many templates as you want to, each in its own group. And then you can use columns in the CSV (spreadsheet) to pick one or more templates to use for each copy ("counter") that is created. If you are making copies of a mail for mass-mailing, that is the stereotypical example for using a tool like that, then all you do is replace some text (e.g. the address and recipient name). But if you make something like a deck of cards for a game then you are likely to need to mix several different designs. And since some things are going to show up on different types of cards you also want the ability to layer different templates on top of each other. It gets a bit complex of course.

Generator and my extension have in common that the first row in the CSV is used to specify what each column is used for. It seems more common, like in inDesign, that you use some GUI in the application to specify what the columns are for instead. So sometimes you need to put some slightly technical/scary things in the column headers (e.g. "title[style:fill]=white", which means "set the fill style of the element with id title using values from this column, and the default if the cell is empty is white"). But usually the header is just a plain id (like in the Generator examples).

My main inspiration originally was a Windows application called nanDeck that is very popular with board game designers. It is a stand-alone application and comes with its own scripting language and own text-based graphics descriptions. I thought it would make much more sense to make a tool like that but basing it on standard file-formats and leverage the GUI and SVG-rendering already in Inkscape (and support more platforms). It was more by accident that my solution ended up looking like mail/data merge tools.

http://www.nand.it/nandeck/

Maybe it would make sense to fork my extension and try to make a variant that is more like a pure mail/data merge (like Generator but more features) and remove the board game stuff, and come up with a better name. But that is not something I have any plans to do right now.

But I rant too much. I was never very good at being economic with words. That also causes some problems in my documentation. The page describing how to make your own templates is horrible and way too long:

https://github.com/lifelike/countershee ... -Templates

Moini
Posts: 2853
Joined: Mon Oct 05, 2015 10:44 am

Re: countersheets extension (counters, cards, mail merge from CSV)

Postby Moini » Mon Jul 23, 2018 10:15 pm

Yes! Thank you, Pelle. These explanations are understandable. So it can replace colors, text etc., potentially even paths? Or is it limited to a subset of attributes? It seems to hold many hidden gems. Please, please share it on inkscape.org!

I think the second paragraph here (viewtopic.php?f=11&t=33895#p105491) provides a great summary.

What I remember about Generator is that it outputs many separate SVG files, I don't remember if it allows to arrange the output in a grid - don't think so, but not sure.

For your documentation, if you don't want to/can't invest time into rephrasing it, I believe some screenshots could be helpful.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

pelle
Posts: 50
Joined: Wed Mar 05, 2008 8:23 am

Re: countersheets extension (counters, cards, mail merge from CSV)

Postby pelle » Tue Jul 24, 2018 6:26 pm

Thanks!

It can replace any SVG attribute, however some are difficult to use. For instance if you set the transform attribute sometimes parts can end up all over the page (have on my TODO list that there needs to be a way to specify rotations and scales in a safe way). It should be possible to set a path, but usually it is probably easier to draw different paths and for instance use what Inkscape calls a clone (a SVG use element, behind the scenes) to replace a path with a different path.

https://github.com/lifelike/countershee ... iki/Clones

Only started to add images to the documentation a few days ago when I finally sat down to read up about how to add them in the GitHub wiki. Now that I know how it works I plan to add some now and then.

Moini
Posts: 2853
Joined: Mon Oct 05, 2015 10:44 am

Re: countersheets extension (counters, cards, mail merge from CSV)

Postby Moini » Wed Jul 25, 2018 1:01 am

The next time I see a question from someone asking how to programatically exchange items in their images, I'll point them to your extension :)
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

wyatt121
Posts: 10
Joined: Wed Jan 03, 2018 8:15 am

Re: countersheets extension (counters, cards, mail merge from CSV)

Postby wyatt121 » Fri Jul 27, 2018 6:21 pm

Hi Pelle,

Great extension!. I'm very excited to try. I have been working with Inkscape command lines, and have become very frustrated with the inability to pass values on the command line. It seems I may be able to pass values with your extension and a CSV file. Here are the 3 things I'm trying to accomplish...

1. Change selected text object font size to a specific value
2. Scale selected paths to a specific size
3. Rotate selected objects by a specific value

Can I store these values in a CSV file, run your extension, and all my problems are solved? Say YES please! :)

Any help is very much appreciated.

Regards,

Wyatt


Return to “Inkscape Resources”

Who is online

Users browsing this forum: No registered users and 1 guest