简体   繁体   English

无法使用apache蜡染将SVG文件转换为PDF文件

[英]Cannot convert SVG file to PDF file use apache batik

I have a lot of SVG files that needed to be converted into PDF files. 我有很多需要转换为PDF文件的SVG文件。
When I call Batik from console, I get the following error; 当从控制台调用Batik时,出现以下错误;

~\batik-1.10>java -jar batik-rasterizer-1.10.jar -d "D:/PDF" -m application/pdf 
-dpi 1200 -w 9921 -h 14031 "D:/SVG/topic*.svg"

> About to transcode 1 SVG file(s)
> Converting d:/SVG/topic*.svg to D:\PDF\topic*.pdf ... ... error (SVGConverter.error.cannot.open.source)
> org.apache.batik.apps.rasterizer.SVGConverterException: Error: cannot open source topic*.svg java.io.IOException: Unable to make sense of URL for connection
    at org.apache.batik.apps.rasterizer.SVGConverter.transcode(SVGConverter.java:968)
    at org.apache.batik.apps.rasterizer.SVGConverter.execute(SVGConverter.java:717)
    at org.apache.batik.apps.rasterizer.Main.execute(Main.java:937)
    at org.apache.batik.apps.rasterizer.Main.main(Main.java:990)

What is the problem here? 这里有什么问题?

I was able to recreate your problem (getting the IOException with message "Unable to make sense of URL for connection"), using your command as listed. 我能够使用列出的命令来重新创建您的问题(使用消息“无法理解用于连接的URL”获得IOException)。

I think in this case, the easiest thing to do would be to eliminate the use of quotes on your source directory path, and execute the following: 我认为在这种情况下,最简单的方法是取消在源目录路径上使用引号,并执行以下操作:

java -jar batik-rasterizer-1.10.jar -d "D:/PDF" -m application/pdf -dpi 1200 -w 9921 -h 14031 D:/SVG/topic*.svg

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM