// Open rptdocument
IReportDocument rptdoc = engine.openReportDocument(document.getAbsolutePath());
// Create Render Task
IRenderTask renderTask = engine.createRenderTask(rptdoc);
PDFRenderOption optionsPDF = new PDFRenderOption();
optionsPDF.setOutputFileName("D:/Temp/output.pdf");
optionsPDF.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF);
renderTask.setRenderOption(optionsPDF);
// render
renderTask.render();
// render the report and destroy the engine
// Note - If the program stays resident do not shutdown the Platform or the Engine
// rptdoc.close();
renderTask.close();
runTask.close();
engine.shutdown();
Platform.shutdown();
RegistryProviderFactory.releaseDefault();