I have a JasperPrint that is exported to PDF and it's showing embedded into a web page.
Is it possible to set the initial zoom in any way?
I know how to do it with POI (by javascript), but I don't find the way to add the JavaScript code in Jasper...
EDIT:
Thanks to the link of @ AlexK, I found the solution :)
public ByteArrayOutputStream fillPDF(JasperPrint jasperPrint) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try{
JRPdfExporter exporter = new JRPdfExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
exporter.setParameter(JRPdfExporterParameter.PDF_JAVASCRIPT, "this.zoom = 70;");
exporter.setParameter(JRPdfExporterParameter.OUTPUT_STREAM,baos);
exporter.exportReport();
}catch (Throwable e){
}
return baos;
}