gpt4 book ai didi

java - 如何在 Apache FOP 2.3 中将字体呈现为形状

转载 作者:行者123 更新时间:2023-11-30 10:01:04 26 4
gpt4 key购买 nike

我想将旧的 FOP 0.94 更新到新的 FOP 2.3。在旧的 FOP 中,字体呈现为形状。我想保留此行为,因此我尝试将以下内容设置为 PDFTranscoder。:

PDFTranscoder pdfTranscoder = new PDFTranscoder();
pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_STROKE_TEXT, Boolean.TRUE);

但如果这样做,输出的 PDF 中将不会呈现任何字体。我如何告诉 FOP 将字体呈现为形状?

如果我删除:

pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_STROKE_TEXT, Boolean.TRUE);

然后文本在输出的 PDF 中,但未呈现为形状

最佳答案

Notes on text painting

There used to be an additional hint, AbstractFOPTranscoder.KEY_STROKE_TEXT (Content: java.lang.Boolean), but this hint has been disabled. It was used to force painting text as shapes.

The PDF Transcoder today uses PDF operations whenever possible to paint text. Only for cases like special effects or transformations Batik will convert the text into shapes. Text output as shapes will negatively affect performance and will result in a bigger PDF. There's currently no work-around other than investing some time in improving text output in the PDF Transcoder. Help is welcome.

https://cwiki.apache.org/confluence/display/XMLGRAPHICSBATIK/PdfTranscoder#space-menu-link-content

关于java - 如何在 Apache FOP 2.3 中将字体呈现为形状,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57656624/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com