Gah, I can’t find a good SVG → PDF tool that I could install at my webhoster. I downloaded the *svgtopdf* module from the InkScape svn repository, installed PDF::API2 in my home directory, and tried it.
alex@mirabel:~$ svgtopdf < test.svg > test.pdf Can't call method "value" on an undefined value at /home/alex/lib/perl5/SVG2/ToPDF.pm line 57.
It seems that the library requires a height and width of the document to be specified. Ok, try again...
alex@mirabel:~$ svgtopdf < test.svg > test.pdf Creating a page: 1600, 1200 Unknown Object Found 'defs' Unknown Object Found 'use' Unknown Object Found 'use' Unknown Object Found 'use' Unknown Object Found 'use'
Gah! That’s the central idea behind the SVG I’m generating: I define each hex only once, and then rely on the `use` element to assemble the map. (2007-06-02 Hex Mapping)
No good.
There’s a svg2pdf that is part of Cairo which works more or less. I built it on my webhost machine. I downloaded, configured using `--prefix=/home/alex`, compiled, and installed the following from source:
1. libsvg 0.1.4
2. cairo 1.4.6
3. libsvg-cairo 0.1.6
4. svg2pdf 0.1.3
Building required me to set `PKG_CONFIG_PATH=/home/alex/lib/pkgconfig`, and running requires me to set `LD_LIBRARY_PATH=/home/alex/lib`.
Check out my old-school-hex script with PDF support. Source available. ¹
old-school-hex script with PDF support
Why am I not 100% happy? Somehow the PDF output doesn’t look too good. The aspect ratio is wrong, I think.
#Software #Web #Inkscape #PDF #SVN