pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1827025 - /pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java
Date Fri, 16 Mar 2018 17:06:36 GMT
Author: tilman
Date: Fri Mar 16 17:06:36 2018
New Revision: 1827025

URL: http://svn.apache.org/viewvc?rev=1827025&view=rev
Log:
PDFBOX-2941: trigger premature initializations for more accurate rendering benchmarks

Modified:
    pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java

Modified: pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java?rev=1827025&r1=1827024&r2=1827025&view=diff
==============================================================================
--- pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java (original)
+++ pdfbox/trunk/debugger/src/main/java/org/apache/pdfbox/debugger/PDFDebugger.java Fri Mar
16 17:06:36 2018
@@ -111,6 +111,10 @@ import org.apache.pdfbox.io.IOUtils;
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.pdfbox.pdmodel.common.PDPageLabels;
 import org.apache.pdfbox.pdmodel.encryption.InvalidPasswordException;
+import org.apache.pdfbox.pdmodel.font.PDFont;
+import org.apache.pdfbox.pdmodel.font.PDType1Font;
+import org.apache.pdfbox.pdmodel.graphics.color.PDDeviceCMYK;
+import org.apache.pdfbox.pdmodel.graphics.color.PDDeviceRGB;
 import org.apache.pdfbox.pdmodel.interactive.viewerpreferences.PDViewerPreferences;
 import org.apache.pdfbox.printing.PDFPageable;
 
@@ -230,7 +234,13 @@ public class PDFDebugger extends JFrame
                 new ErrorDialog(throwable).setVisible(true);
             }
         });
-        
+
+        // trigger premature initializations for more accurate rendering benchmarks
+        // See discussion in PDFBOX-3988
+        PDFont font = PDType1Font.COURIER;
+        PDDeviceCMYK.INSTANCE.toRGB(new float[]{0,0,0,0});
+        PDDeviceRGB.INSTANCE.toRGB(new float[]{0,0,0});
+
         // open file, if any
         String filename = null;
         String password = "";



Mime
View raw message