Search code examples
javac#pdfstreamjasperstarter

Outpuf PDF as a stream for calling process


I'm using jasperstarter (a java program, open source) to generate reports that I define in iReports. This runs in windows and I need the output PDF generated to be directly read by the calling process which is a C# program.

Jasperstarter has lots of options like viewing the PDF generated directly, or generating the PDF as a file, sending it to printer, but no option to stream the result PDF to the calling process.

Is this possible at all, even if I have to change jasperstarter's open source code? How? Is this possible in some other way that doesn't imply changing the jasperstarter's code? How?


Solution

  • Actually the answer was quite easy. I've downloaded jasperstarter and was able to use JasperExportManager.exportReportToPdfStream method which already existed on jasper's library to export the pdf to "System.out" stream. Together with adding a new option to run this process, this makes jasperstarter to be able to allow for redirection of the PDF's result (pipe '|' and redirect can be used directly on the program).

    I tried contact with jasperstarter's project owner to see if I can get this change commited on the master branch.