Page 1 of 1

Suggestions for vector pdf creation

Posted: 2012-01-29T12:04:03-07:00
by willroy
I know Imagemagick is not the tool for producing vector pdfs but I am wondering if anyone else has faced and overcome this issue, with or without IM.

I produce a 'multi-layered' image in IM by compositing a group of other images (including text). I do this via PHP and the Imagick class. I have currently tried using tcpdf to produce my vector copy of the image, but finding problems with minor differences of how the 2 scripts size and position fonts.

I understand pstoedit offers some vector production features through a plugin for IM but being a PHP developer I can't adapt this well for my project.

Any help appreciated..

Re: Suggestions for vector pdf creation

Posted: 2012-01-31T07:17:34-07:00
by anthony
IM can generate SVG from bitmap images. if the autotrace library was present when IM was built.
Or you can use autotrace directly!

At least for images, not so good for text which requires OCR to generate vector text (this is also part of DjVu scan documents, if you can make any understandign of it - I haven't yet)

SVG can then be converted to vector PDF.


For example of bitmap to SVG vector conversion see..
http://www.imagemagick.org/Usage/transform/#edge_vector
and
http://www.imagemagick.org/Usage/draw/#svg_output

WARNING: if SVG was not available IM generates a dot for every pixel! Arrrgggghhhhh....
I think Morphology distance and skeleton methods, may provide a better solution in this regard!