I'm not sure you need a full script for something like this, here's some hints on how I'd do it.
On Sun, 2007-08-26 at 13:24 -0700, sunil joshi wrote:
- Open one of the three templates
- Modify the text in the template, and save the file
as new label.
If you replace the text with this:
<?php print($argv[1]); ?>
Then you can do this:
php myfile.svg "the text I want there" > mynewfile.svg
(Note: I don't think you can do this in Inkscape as it'll replace the '<' with '<', but you can do it in a text editor)
- Export file as png (check examples
http://www.jayateas.com/images/badamtamteabaglabel.png http://www.jayateas.com/images/badamtamloosetealabel.png )
inkscape --export-png="mynewfile.png" mynewfile.svg
- Open new 8.5x11 document, and import png file
- Resize png import, and place accurately using x
and y values 6. Tiled Clone to create a row of three (some x & y shift values need to be changed) 7. Tiled clone to duplicate the row to 10 rows (some x & y shift values need to be changed)
If you create this with a linked image (it points to /mydir/mynewfile.png on the filesystem) then you can create the new document just by changing /mydir/mynewfile.png.
- Save as a new file. check example -
http://www.jayateas.com/images/badamtamloosetealabelsheet.png
- Print file
I am not sure what all can be completely automated, but I am sure some of these could be easily automated.
These are some quick suggestions that should get most of the tedious parts out of your workflow. If you haven't already I'd definitely watch Andy's talk from LGM about text boxes and the such. He's specifically talking about translation of SVG documents, but it applies to any dynamic text.
http://people.xiph.org/~giles/2007/lgm/LGM_20070506-4-Andy_Fitzsimon.ogg
--Ted