【问题标题】:Is there a way to view rptdesign as PDF without creating PDF file first?有没有办法在不先创建 PDF 文件的情况下以 PDF 格式查看 rptdesign?
【发布时间】:2018-10-03 06:45:37
【问题描述】:

目前我正在查看 birt rptdesign 作为 PDF,方法是先创建 PDF 文件,如下所示:

design = engine.openReportDesign("c:/temp/customer.rptdesign");
task = engine.createRunAndRenderTask(design);
PDFRenderOption options = new PDFRenderOption();
options.setOutputFileName("c:/temp/customer.PDF");
options.setOutputFormat("PDF");

然后我用 desktop 打开它,如下所示:

File file = new File("c:/temp/customer.PDF");
try {
    Desktop.getDesktop().open(file);
} catch (IOException e) {e.printStackTrace();}

有没有办法直接以PDF格式查看而不先创建PDF文件?

我正在使用 jdk-8u181-windows-i586 和 birt-runtime-4.8.0-20180626。

谢谢。

【问题讨论】:

    标签: java pdf birt


    【解决方案1】:

    您可以使用示例 servlet,或编写自己的 servlet。

    【讨论】:

    • 是用setOutputStream方法替换setOutputFileName吗?
    • 是的,这基本上就是示例 servlet 的工作方式。您可以从 BIRT 网站的某个地方下载示例 servlet 的源代码。
    猜你喜欢
    • 1970-01-01
    • 2021-12-30
    • 2013-07-09
    • 2012-03-20
    • 1970-01-01
    • 2012-07-25
    • 1970-01-01
    • 1970-01-01
    • 2021-12-19
    相关资源
    最近更新 更多