Convert SVG to PDF with GhostScript/GhostPDL?

故事扮演 提交于 2019-12-25 06:01:45

问题


Question:
It is possible to convert SVG to PDF using GhostPCL, like this:

gsvg.exe -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile=my.pdf t1.svg

The difficulty is getting gsvg.exe...
I managed to find the source from:
http://svn.ghostscript.com/ghostscript/trunk/
and it built and compiled and it works fine.

However, when I go to http://svn.ghostscript.com, then it states:

SVN is decprecated, Ghostscript and associated projects are now hosted only in git repositories, see: http://git.ghostscript.com

So I tried to get the latest version by downloading from the git repository

git clone http://git.ghostscript.com/ghostpdl.git

It built fine, but it looks like gsvg is gone.
Unfortunately, it lacks a bit in the documentation department.
Does anybody know if this functionality has been integrated, deleted, or otherwise moved ?

If it has been integrated, how can I convert a svg to a pdf in the new version (using ghost*) ?

PS:
Yes, I know I can do it with inkscape or rsvg-convert, but they don't work fine for my SVGs (rsvg-convert removes all text), inkscape delivers poor quality svg conversion. CairoSVG seems to be the same as rsvg-convert.
Only ghostsvg works as required.


回答1:


SVG input (gsvg) has been deprecated and removed from Ghostscript. It never worked well and there was not sufficient interest to bring it up to date and maintain it.

If you're really desperate you can probably take the gsvg sources and glue them together with the current graphics library and output devices, nothing has changed in the Ghostscript API so this 'should' all still work, but the directory structure has been reworked and the makefiles modified to match, so its not going to be simple.



来源:https://stackoverflow.com/questions/33257452/convert-svg-to-pdf-with-ghostscript-ghostpdl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!