Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a template for a business card and a text file with several hundred codes (each separated by commas). Is there a method to (automatically): for each code overlay it onto the template and export an image?

Note: I'm hoping to achieve results similar to this:

share|improve this question
I haven't time for a complete answer now, but you can write a script that uses imagemagick. I will try to post a complete answer later (if I don't forget it). – Javier Rivera Dec 12 '11 at 18:29
You may be able to achieve this with LibreOffice and 'mail merge', however you will need to convert the file so that every code is on its own line. – aquaherd Dec 14 '11 at 21:22
@Javier If you could explain how to use, and do this, in ImageMagick that would be fantastic! – hayd Dec 17 '11 at 23:54
@aquaherd My image template is a PNG file so I don't think Libre Office can open/edit it very well (though I could well be wrong!). – hayd Dec 17 '11 at 23:57
up vote 1 down vote accepted

gLabels install glabels is a very useful & powerful program to do such things, although normally it will print and not create new images. (You might have to reformat the text file into a CSV file or something like that, but that should be easy enough—if not, ask how to do it in another question on this site...)

Alternatively, LibreOffice should be able to do something similar too.

If you really want to make hundreds of images, you could probably use ImageMagic.

share|improve this answer
gLabels appears to put things (like business cards) into a printable format, so 12+ per A4 sheet. I need it to export one file per code. Though I could be wrong! – hayd Dec 17 '11 at 23:59
As you probably figured out by now: you can use the "mail merge" features to make each business card unique. – JanC Jun 10 '12 at 23:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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