英文:
Generating PDF from 'qute' HTML template in Quarkus: any alternatives to flying-saucer-pdf?
问题
生成PDF的方法是从使用“qute”模板生成的HTML中生成PDF(在原生模式下工作)。我使用的是flying-saucer-pdf,但似乎与原生构建不兼容。ITextRenderer在GraalVM中抛出异常:“在解析过程中发现未解决的方法:org.xhtmlrenderer.layout.BoxBuilder.createRootBox”。
英文:
is there a way to generate pdf from an html generated with "qute" templating ? (Works in native mode)
My point is that I use flying-saucer-pdf but it seems incompatible with native build. ITextRenderer throw an exception in graalvm : "Discovered unresolved method during parsing: org.xhtmlrenderer.layout.BoxBuilder.createRootBox".
答案1
得分: 3
我正在使用openhtmltopdf:
String result = transformersPDF.data("equipments", infoList, "filters", filterList).render();
PdfRendererBuilder builder = new PdfRendererBuilder();
builder.useFastMode();
builder.withHtmlContent(result, imagePath);
builder.toStream(baos);
transformersPDF 被注入:
@Inject
Template transformersPDF;
在Kubernetes环境中出现问题:
即使在本地工作时,图像也无法呈现。
希望有所帮助
(我很匆忙,抱歉无法进一步详细说明)
英文:
I'm using openhtmltopdf:
String result = transformersPDF.data("equipments", infoList, "filters", filterList).render();
PdfRendererBuilder builder = new PdfRendererBuilder();
builder.useFastMode();
builder.withHtmlContent(result, imagePath);
builder.toStream(baos);
transformersPDF is injected
@Inject
Template transformersPDF;
It works fine, but now I'm facing issues in kubernetes environment:
Images are not being rendered even when worked locally.
Hope it helps
(I'm in a hurry, sorry I can't elaborate further)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论