[Noisebridge-discuss] SVG + PNG = PDF?

Seth David Schoen schoen at loyalty.org
Fri Jun 3 20:02:04 UTC 2011


Rubin Abdi writes:

> I don't think Imagemagick is up to this task, so I'm stuck.
> 
> I have...
> 
> * 1 SVG, it's detailed
> * 1200 PNGs
> 
> I would like to basically take these things, and generate a large 1200
> page PDF, where each page contains the same page sized SVG, with 1
> unique PNG watermarking the corner.
> 
> What can I use to script this?

I'm not at all expert on this but one idea is something like

- use Inkscape to convert the SVG to EPS
- use epstopdf to convert the EPS to PDF
- use ImageMagick to convert the PNGs into PDFs (for input to
  pdftk in the next step)
- use pdftk to watermark the pages with the "background" or "stamp"
  commands
- use pdftk to assemble the pages into one large PDF file

My main uncertainty about this is whether the first two steps result
in a PDF file where the image is genuinely still in vector format (it
looks like it to me, but I don't know enough to verify this quickly)
and whether the first two steps may inadvertently lose some kind of
SVG format features that are not supported in EPS, so that some of
the features or details of the original SVG are missing.

The pdftk part should do what you want if you can just get the SVG
turned into a one-page PDF.  You can run pdftk from a shell script
easily.

-- 
Seth David Schoen <schoen at loyalty.org>      |  No haiku patents
     http://www.loyalty.org/~schoen/        |  means I've no incentive to
  FD9A6AA28193A9F03D4BF4ADC11B36DC9C7DD150  |        -- Don Marti



More information about the Noisebridge-discuss mailing list