如何以编程方式将包含文本的 SVG 文件转换为 PDF 文件(特别是在 CentOS 5.3 x86_64 上)?
我想以编程方式将 SVG 文件转换为 PDF 文件。但是,SVG 文件包含必须可在生成的 PDF 文件中搜索的文本。此外,它还必须适用于 x86_64 架构的 Red Hat Enterprise Linux 5.3 或 CentOS 5.3。如果它是开源的或者至少不是很昂贵,那就太好了。
这是我尝试过的。除了 Batik 之外,所有这些都可以在 Debian Lenny 上正常运行。
Inkscape
我可以使用 http://inkscape.modevia.com/ap 中的自动软件包安装它,但是当我从命令行使用它,文本不可搜索。
蜡染光栅化器 [原文如此]
当它将 SVG 文件转换为 PDF 文件时,文本将不再可搜索。
svg2pdf
该源及其几个依赖项可以下载。我一直在尝试让它在 CentOS 上编译,但还没有成功。我找到了 Debian x86_64 的 预编译版本,但它不适用于 CentOS 。
rsvg-convert
生成的 PDF 在 CentOS 5.3 上不可搜索。也许安装较新版本的 cairo 会有所帮助。感谢 DaveParillo 提到 rsvg-convert(在超级用户上)。
解决方案(但也许上面的一些内容对读者仍然有用)
princeXML
从源代码安装时,它在 CentOS 上运行良好。由于某种原因,从 .rpm 安装时它不起作用。谢谢埃里克·达尔斯特罗姆!
I would like to programatically convert SVG files to PDF files. However, the SVG files contain text that must be searchable in the generated PDF files. Also, it has to work on Red Hat Enterprise Linux 5.3 or CentOS 5.3 for the x86_64 architecture. It would be nice if it were Open Source or at least not very expensive.
Here is what I've tried. All of these, except Batik, work fine on Debian Lenny.
Inkscape
I can get it installed using autopackages from http://inkscape.modevia.com/ap, but when I use it from the command line, the text is not searchable.
Batik rasterizer [sic]
When it converts SVG files to PDF files, the text is no longer searchable.
svg2pdf
The source for this and several of its dependencies are available to download. I have been trying to get it to compile on CentOS, but haven't had success yet. I found a precompiled version for Debian x86_64, but it doesn't work on CentOS.
rsvg-convert
Generated PDF isn't searchable on CentOS 5.3. Perhaps installing a newer version of cairo would help. Thanks to DaveParillo for mentioning rsvg-convert (on superuser).
SOLUTION (but perhaps some of the above will still be useful to the reader)
princeXML
It works fine on CentOS when installed from source. For some reason it doesn't work when installed from the .rpm. Thanks Erik Dahlström!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试 princexml,它对于非商业用途是免费的。
You could try princexml, it's free for non-commercial use.