My certificate-maker program
Hi all,
You might be interested in what I did with Inkscape, YAML, and a couple hundred lines of Pthon...
I teach a troubleshooting course, and a client asked for certificates of completion for all the client's students. So here's what I did:
I used Inkscape to make the certificate, complete with a nice triple-line border. Everywhere that needed something specific, such as venue (for example "ABC Corp in Indianapolis, IN"), I put @variablename@...95... Most of those variables, such as venue and date range, were per-course, but the student name was per-student.
I saved this Inscape file uncompressed for easy parsing. To drive the run, I used a YAML file something like what you see below my sig. I think if you look at the YAML file you can pretty much envision the Python program.
The Python program looped through the YAML graduates list, and for each one:
* For each key in tokens, replaced @tokenkey@ with the token's value in the Inscape file * Wrote the SVG result to an output file in run_info['output_dir'] * Converted that SVG file to a PDF
My client was delighted both with the quality of the result and the speed with which I did it.
Because of its native text format and its ability to do complex graphics, Inkscape provides the ideal bridge between data and graphics.
Thank you for giving us Inkscape.
SteveT
Steve Litt * http://www.troubleshooters.com/ Troubleshooting Training * Human Performance
############################################## run_info: template: 03_example_diploma.svg # MUST PUT SLASH AT END OF output_dir output_dir: ./finishedfiles/
tokens: company: Johnson Oil, Incorporated, office: Orlando, Florida daterange: March 12-13, 2013 signdate: March 15, 2013
graduates: - Alex Anderson - Brittany Baumgartner - Charles Custer - Dianna Donovan - Edward Ellsworth - Felice Fernandez ##############################################
On Mon, 2013-07-15 at 14:05 -0400, Steve Litt wrote:
Because of its native text format and its ability to do complex graphics, Inkscape provides the ideal bridge between data and graphics.
I always thought a mail-merge type feature would be useful for inkscape. Python and the ability to open a few kinds of data-sources, but it would certainly be better than the same code being rewritten to account for data-merging.
What are your thoughts Steve? should we have this as a feature by default?
Martin,
Indeed it would be useful. Some time ago I did the same but with the help of sed and svg2pdf.
On Mon, Jul 15, 2013 at 2:58 PM, Martin Owens <doctormo@...155...> wrote:
On Mon, 2013-07-15 at 14:05 -0400, Steve Litt wrote:
Because of its native text format and its ability to do complex graphics, Inkscape provides the ideal bridge between data and graphics.
I always thought a mail-merge type feature would be useful for inkscape. Python and the ability to open a few kinds of data-sources, but it would certainly be better than the same code being rewritten to account for data-merging.
What are your thoughts Steve? should we have this as a feature by default?
Martin,
See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clk... _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-user
On Mon, 15 Jul 2013 15:58:11 -0400 Martin Owens <doctormo@...155...> wrote:
On Mon, 2013-07-15 at 14:05 -0400, Steve Litt wrote:
Because of its native text format and its ability to do complex graphics, Inkscape provides the ideal bridge between data and graphics.
I always thought a mail-merge type feature would be useful for inkscape. Python and the ability to open a few kinds of data-sources, but it would certainly be better than the same code being rewritten to account for data-merging.
What are your thoughts Steve? should we have this as a feature by default?
Martin,
Hi Martin,
I'm a big fan of do one thing and do it well, and IMHO Inkscape's one thing is graphics.
My viewpoint is that every added line of code gives bugs more places to hide, so I'm very skeptical of adding non-core features. Especially when it's so easy to do what I did.
So my opinion is "no". If the project would like, I could make some sort of howto to explain how to do it.
SteveT
Steve Litt * http://www.troubleshooters.com/ Troubleshooting Training * Human Performance
I commonly use this inkscape extension (http://wiki.colivre.net/Aurium/InkscapeGenerator) to have some sort of mail-merge feature. I does more or less the same as Steve introduced in a similar way. From my point of view I would recommend it, especially if you don't wont to try yourself writing an inkscape plugin :)
Cheers Jakob
I've done something similar using Ruby to convert Inkscape-layers to the glyphs of a SVG font. My earlier post about that got completely ignored, but I believe the both the technique and the application could be interesting for others...?
This script turns Inkscape into a font-editor. Ofcourse, this was already possible, but slightly clumpsy. With my Ruby script, you can use Inkscape's guides for the font-metrics.
Another Ruby scripts creates a starting template with a appropiately named layer for every glyph and guides for the font-metrics.
Groetsels!
Maarten
On Tuesday, July 16, 2013, Jakob Gager wrote:
I commonly use this inkscape extension ( http://wiki.colivre.net/Aurium/InkscapeGenerator) to have some sort of mail-merge feature. I does more or less the same as Steve introduced in a similar way. From my point of view I would recommend it, especially if you don't wont to try yourself writing an inkscape plugin :)
Cheers Jakob
See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clk... _______________________________________________ Inkscape-user mailing list Inkscape-user@lists.sourceforge.net javascript:; https://lists.sourceforge.net/lists/listinfo/inkscape-user
Am 15.07.2013 20:05, schrieb Steve Litt:
Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clk...
Spam?
Am 15.07.2013 23:24, schrieb Lars Behrens:
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clk...
Spam?
Oh, just noticed that this address is underneath all the mails on the list.
On Mon, 15 Jul 2013 23:27:19 +0200 Lars Behrens <lars.behrens@...2842...> wrote:
Am 15.07.2013 23:24, schrieb Lars Behrens:
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clk...
Spam?
Oh, just noticed that this address is underneath all the mails on the list.
It's OK. I haven't used up this moth's quota of mistakes either:)
participants (8)
-
Abrolag
-
Eneko Gotzon Ares
-
Jakob Gager
-
Lars Behrens
-
Maarten van der Velde
-
Martin Owens
-
Steve Litt
-
William Oquendo