为什么 FOP 需要这么长时间才能将此文档发送到打印机?

发布于 2024-09-27 15:33:38 字数 547 浏览 0 评论 0原文

在我们的软件中,我们使用 Apache FOP 0.20.5(我知道这是一个旧版本,我们无法更新它,因为它是我们软件的旧版本)来创建“漂亮”风格的报告。我们特别创建了一个,方法是将 PDF 导入 InkScape,然后从中生成 SVG 的 XML。当将此特定表格发送到打印机(通过 -print 选项)时,需要非常长的时间,即 5 分钟以上。当我进行打印预览 (-awt) 或直接将其发送到 pdf (-pdf) 时,几乎不需要任何时间,但文本有严重的伪影,甚至无法阅读。

我们使用许多其他报告/表单来执行此操作,这些报告/表单具有独特/复杂的样式表,据我所知没有任何问题。有人知道这里会发生什么吗?理想情况下,我会解决速度问题,但仅删除 -pdf 版本上的工件就足够了。我已手动检查 InkScape 创建的 xsl 并尝试删除任何非关键内容,但似乎没有任何区别。

我很乐意听到任何想法,无论它们有多么牵强。

编辑:忘记提及这个错误在打印过程中被吐出数百(数千)次:

Graphics2D from BufferedImage lacks BUFFERED_IMAGE hint

In our software, we use Apache FOP 0.20.5 (I know this is an old version, we can't update it as it's an old version of our software) to create "pretty" style reports. We have one in particular that I created by importing a PDF into InkScape then generating the XML of the SVG(s) from that. When sending this particular form to the printer (via the -print option), it takes an exceptionally long time, i.e. 5+ minutes. When I do either a print preview (-awt) or send it directly to a pdf (-pdf) it takes hardly any time at all, but the text has HEAVY artifacting to the point of it not even being readable.

We do this with plenty of other reports/forms that have unique/complicated stylesheets without problems that I know of. Does anybody have ANY idea what could be going on here? Ideally I'd fix the speed issue, but a workaround of just removing the artifacts on the -pdf version would be sufficient. I've manually gone through the xsl that InkScape creates and tried to remove anything non-critical, but it doesn't seem to make any difference.

Would love to hear any ideas no matter how far fetched they may be.

Edit: Forgot to mention that this error gets spat out hundreds (thousands) of times during the print process:

Graphics2D from BufferedImage lacks BUFFERED_IMAGE hint

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

惜醉颜 2024-10-04 15:33:38

我发现:

InkScape 的输出为我的每个图层添加了 标签。显然,FOP 处理这些问题比不处理这些问题要多花 2 个数量级的时间。

我拉出了所有 的内容,我的 5 分钟内容在 5 秒内神奇地呈现出来。

I figured it out:

The output from InkScape had put <g> tags in for each of my layers. Apparently, FOP takes 2 full orders of magnitude more time to deal with these than not.

I pulled out all the <g>'s and my 5 minute thing magically rendered in 5 seconds.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文