How to programmatically convert SVG to PDF on Windows?

☆樱花仙子☆ 提交于 2020-01-12 02:43:13

问题


I'm looking to programmatically convert SVG to PDF documents on a server. What are my options for doing that on Windows?

I've seen links to Inkscape, Batik, and svg2pdf, but I'm not sure if these can easily be automated to perform the conversion on a Windows server.

There's an unusual solution here which involves automating OpenOffice Portable on the server: http://www.codeproject.com/KB/office/PortableOpenOffice.aspx


回答1:


There are two options:

  • Batik (Java, open source)
  • Inkscape (native binary, open source)

Batik will give you more control. With Inkscape, you can use the command line parameters (--export-pdf IIRC) to do the conversion without firing up the UI.




回答2:


Take a look at the Apache Batik Toolkit. The rasterizer can convert svg to images or pdf (It's a java tool).

The SVG Rasterizer is a utility that can convert SVG files to a raster format. The tool can convert individual files or sets of files, making it easy to convert entire directories of SVG files. The provided formats are JPEG, PNG and TIFF, however the design allows new formats to be added easily. In addition, the rasterizer can (despite its name) transcode to PDF.




回答3:


It does not come free, but PrinceXML does a very good job with SVG.




回答4:


You can probably use Cairo and librsvg to read SVG into Cairo surface and export to PDF using Cairo. There are many bindings for languages and these are open source libraries.




回答5:


You can use altsoft xml2pdf server for this




回答6:


http://www.databasesandlife.com/svg-to-pdf/




回答7:


you might want to look into Apache FOP.
Check out the part about graphic formats.



来源:https://stackoverflow.com/questions/1048205/how-to-programmatically-convert-svg-to-pdf-on-windows

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