I use Inkscape on Windows and going to use it on Debian for convert PDF to SVG by the command line. With GUI Inkscape work very well, I can import PDF via Poppler, but i can not do it by command line, Inkscape convert PDF image to text and the picture looks bad.
This is my command line:
--without-gui --file my.pdf --export-text-to-path --export-plain-svg=my.svg
This is PDF
This is result SVG
Is it possible to do a good conversion by the command line?
Convert PDF to SVG by command line
Re: Convert PDF to SVG by command line
Hi,
somebody made me aware of Windows-"Standalone" Version of Poppler...
http://blog.alivate.com.au/poppler-windows/
Go to the \bin directory and start pdftocairo.exe
Command line usage:
So, there is no need anymore to use Inkscape for conversion of PDF to SVG
It worked for me (as far as I have tested). Although, I noticed very small distortions in the SVG. And text is obviously converted into Paths.
Hope, it works also for you.
somebody made me aware of Windows-"Standalone" Version of Poppler...
http://blog.alivate.com.au/poppler-windows/
Go to the \bin directory and start pdftocairo.exe
Command line usage:
Code: Select all
pdftocairo.exe -svg "Input.pdf" "Output.svg"
So, there is no need anymore to use Inkscape for conversion of PDF to SVG
It worked for me (as far as I have tested). Although, I noticed very small distortions in the SVG. And text is obviously converted into Paths.
Hope, it works also for you.
Re: Convert PDF to SVG by command line
Your result looks like Inkscape does not find the proper font and replaces it with some other font.
The formula looks to me like it's from LaTeX which uses a Type 1 Font.
So, I am just guessing that Inkscape does not know to handle such Type 1 Fonts. If you type your formula e.g. with LibreOffice Formula Editor (of course it doesn't look as good as LaTeX ) which is using TrueType Fonts and make a PDF out of it, the following command line conversion works under Win7 (cmd.exe), but apparently not for Type 1 Fonts.
So for your task, the above mentioned Poppler-Standalone seems to be the preferred solution.
The formula looks to me like it's from LaTeX which uses a Type 1 Font.
So, I am just guessing that Inkscape does not know to handle such Type 1 Fonts. If you type your formula e.g. with LibreOffice Formula Editor (of course it doesn't look as good as LaTeX ) which is using TrueType Fonts and make a PDF out of it, the following command line conversion works under Win7 (cmd.exe), but apparently not for Type 1 Fonts.
Code: Select all
inkscape -z -f "Input.pdf" -l "Output.svg"
So for your task, the above mentioned Poppler-Standalone seems to be the preferred solution.
Win7/64, Inkscape 0.92.2