I am working on a project in which I need to write a utility which will do a batch conversion from pdf to svg, I am using following command to do the same,
>inkscape -l test.svg txtNimage.pdf
I am aware that inkscape only converts first page of pdf, I have one work around for it.
I am facing issue with pdf files which has embedded images in it. When I convert such pdf from inkscape to svg and view it firefox browser images inside generated svg are not correctly aligned.
Please find attached generated svg as well. I tried attaching pdf but it says "pdf extension not allowed"
Thanks in advance
-- Sachin.
http://sachhy.blogspot.com/
PDF to svg command line export
-
- Posts: 2
- Joined: Tue Jul 06, 2010 9:47 pm
PDF to svg command line export
- Attachments
-
- test.svg
- (58.19 KiB) Downloaded 189 times
Re: PDF to svg command line export
I have just allowed PDF uploads.
You can't yet trust any web browser to correctly render an SVG file. What you are seeing may be a problem with Firefox and not with the SVG. To check, use Batik Rasteriser to convert the SVG to a bitmap and see how it looks. If it doesn't render properly with Batik, there is probably something wrong with the SVG - http://xmlgraphics.apache.org/batik/too ... rizer.html
You can't yet trust any web browser to correctly render an SVG file. What you are seeing may be a problem with Firefox and not with the SVG. To check, use Batik Rasteriser to convert the SVG to a bitmap and see how it looks. If it doesn't render properly with Batik, there is probably something wrong with the SVG - http://xmlgraphics.apache.org/batik/too ... rizer.html
-
- Posts: 2
- Joined: Tue Jul 06, 2010 9:47 pm
Re: PDF to svg command line export
Thanks for you reply.
Issue persist with batik as well. Please find attached jpeg which generated using batik-rasterizer.jar and also original pdf.
Issue persist with batik as well. Please find attached jpeg which generated using batik-rasterizer.jar and also original pdf.
- Attachments
-
- test.svg
- (58.19 KiB) Downloaded 186 times
-
- txtNimage.pdf
- (202.28 KiB) Downloaded 574 times
Re: PDF to svg command line export
This is an interesting one.
I imagine it would be possible to manually correct this if you understood the transformation matrix system.
The matrix value is matrix(468,0,0,81.7,72,457.6). I don't know the matrix system well enough to understand exactly what these number mean, although I tried - http://www.w3.org/TR/SVGTiny12/coords.h ... rixDefined
I suspect the matrix is influenced by the parent matrixes, otherwise I think some of the number in there would relate directly to the image size. I also suspect that either Inkscape or the SVG viewers are miscalculating the actual size when calculating the transformation, which is why it's squashed.
In any case, I'm not clever enough to figure out exactly what is going wrong. But I suspect the developers might be interested, in which case you should post a bug at https://bugs.launchpad.net/inkscape (and attach your files) and maybe then raise it on the developers mailing list.
I imagine it would be possible to manually correct this if you understood the transformation matrix system.
The matrix value is matrix(468,0,0,81.7,72,457.6). I don't know the matrix system well enough to understand exactly what these number mean, although I tried - http://www.w3.org/TR/SVGTiny12/coords.h ... rixDefined
I suspect the matrix is influenced by the parent matrixes, otherwise I think some of the number in there would relate directly to the image size. I also suspect that either Inkscape or the SVG viewers are miscalculating the actual size when calculating the transformation, which is why it's squashed.
In any case, I'm not clever enough to figure out exactly what is going wrong. But I suspect the developers might be interested, in which case you should post a bug at https://bugs.launchpad.net/inkscape (and attach your files) and maybe then raise it on the developers mailing list.