]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.document/src/org/simantics/document/Exportable.java
Fonts are now embedded in diagram, wiki, etc PDF exports.
[simantics/platform.git] / bundles / org.simantics.document / src / org / simantics / document / Exportable.java
index a1053dd83001dafde9e6923f2a569b3b3d8f1585..a6dd790de51b78937f71ad627f1b27a2e1a01edd 100644 (file)
@@ -105,7 +105,7 @@ public class Exportable implements IExportable {
        }
 
        @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 {
@@ -113,6 +113,7 @@ public class Exportable implements IExportable {
                        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++) {
@@ -123,8 +124,10 @@ public class Exportable implements IExportable {
                        //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);