batik:svg到linux上的pdf(没有X服务器) [英] batik: svg to pdf on linux (no X server)

查看:179
本文介绍了batik:svg到linux上的pdf(没有X服务器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

类似于将SVG转换为PDF
的方法,svg2pdf转换成功运行在Windows和文本项目下可以在生成的pdf中搜索。它在linux(Ubuntu)下生成pdfs(带-Djava.awt.headless = true以避免由于缺少X11窗口服务器而导致的异常),但是文本项目不可搜索,有时甚至被编码为图像。

Similar to approach in Convert SVG to PDF the svg2pdf conversion runs successfully under windows and text items are searchable in the resulting pdf. It produces pdfs (with -Djava.awt.headless=true to avoid exceptions due missing X11 window server) under linux (Ubuntu) as well, but the text items are not searchable and sometimes are even coded as images.

是否可以在linux下保存pdf中的文本,我是否缺少一些运行时选项?

Is it possible to preserve text in pdf under linux as well, am I missing some runtime options?

UPD:我能以某种方式强制蜡染(SVGGraphics2D或SVGConverter)回退到默认字体,如果找不到某种字体?

UPD: Can I somehow force batik (SVGGraphics2D or SVGConverter) to fall back to a default font, if certain font wasn't found?

推荐答案

解决方法按照这里的方法:

Solved by following the recipe here:

http://batik.2283329.n4.nabble.com/Placing-SVG-Text-into-PDF-td3778127.html

主要步骤:


  1. 使用ant all编译fop

  2. copy fop-transcoder名称为pdf-transcoder.jar的-allinone.jar进入类路径

  3. 从fop的lib di复制xmlgraphics-commons-1.4.jar教区长进入类路径

这篇关于batik:svg到linux上的pdf(没有X服务器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆