【问题标题】:Save file opened with navigateToURL保存使用 navigateToURL 打开的文件
【发布时间】:2015-07-08 09:34:12
【问题描述】:

我正在使用 navigateToURL 打开 Jasper 生成的 PDF 文件,它运行良好。现在我被要求发送一封带有 PDF 文件作为附件的电子邮件。我们正在使用 Velocity 在我们的应用程序中发送电子邮件,但是,要发送附件,我们必须将文件保存在某处并具有路径和文件名的信息。 是否可以保存到由 navigateToURL 打开的文件?

我使用的是 Flex SDK 4.9.1。

谢谢。

【问题讨论】:

    标签: apache-flex velocity navigatetourl


    【解决方案1】:

    您是否使用 JasperExportManager.exportReportToPdfStream() 方法来显示 PDF?

    如果是这样,请尝试使用 JasperExportManager.exportReportToPdfFile()。
    然后您可以将 PDF 保存在服务器上。

    JasperPrint jasperprint = JasperFillManager.fillReport(jasper, paramMap, con);
    // Streaming pdf now?
    response.setContentType("application/pdf");
    JasperExportManager.exportReportToPdfStream(jasperprint, response.getOutputStream());
    
    // Save the PDF somewhere.
    JasperExportManager.exportReportToPdfFile(jasperprint, path);
    

    【讨论】:

    • 感谢您的回复。与此同时,我的经理改变了我的优先事项,这对他来说不再紧迫。当我回到这个时,我会尝试你的解决方案。
    猜你喜欢
    • 1970-01-01
    • 2012-02-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多