}
@Override
- public void export(Document document, PdfWriter writer) throws DocumentException {
+ public int export(Document document, PdfWriter writer) throws DocumentException {
File temp = Simantics.getTempfile("wikiPdfExport", "pdf");
try {
temp.getParentFile().mkdirs();
PhantomJSDriver.print(html, settings, temp);
+ int result = 0;
PdfContentByte cb = writer.getDirectContent();
PdfReader reader = new PdfReader(new BufferedInputStream(new FileInputStream(temp)));
for (int i = 1; i <= reader.getNumberOfPages(); i++) {
//add the page to the destination pdf
float pts = Utilities.millimetersToPoints(10);
cb.addTemplate(page, pts, pts);
+ ++result;
}
+ return result;
} catch (IOException e) {
throw new DocumentException(e);