SVG to PDF on a shared linux server

前端 未结 5 1595
庸人自扰
庸人自扰 2020-12-28 09:10

I have a website which uses SVG for an interactive client side thingamabob. I would like to provide the option to download a PDF of the finished output. I can pass the final

5条回答
  •  太阳男子
    2020-12-28 09:42

    You can use Apache FOP's free Batik SVG toolkit which has a transcoder api to transform SVG to PDF.

    download link

    You will need to write a tiny bit of java. There are code examples here – note you will need to set the transcoder to org.apache.fop.svg.PDFTranscoder instead of Java.

    You should be able to do this without installing anything on your machine – just drag the jars on there and run a script. I quote:

    All other libraries needed by Batik are included in the distribution. As a consequence the Batik archive is quite big, but after you have downloaded it, you will not need anything else.

提交回复
热议问题