You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ad...@apache.org on 2011/06/29 01:06:53 UTC

svn commit: r1140892 - /pdfbox/tags/1.5.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDSimpleFontTest.java

Author: adam
Date: Tue Jun 28 23:06:53 2011
New Revision: 1140892

URL: http://svn.apache.org/viewvc?rev=1140892&view=rev
Log:
PDFBOX-1019 - PDF conversion to image crashes the JVM

Modified:
    pdfbox/tags/1.5.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDSimpleFontTest.java

Modified: pdfbox/tags/1.5.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDSimpleFontTest.java
URL: http://svn.apache.org/viewvc/pdfbox/tags/1.5.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDSimpleFontTest.java?rev=1140892&r1=1140891&r2=1140892&view=diff
==============================================================================
--- pdfbox/tags/1.5.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDSimpleFontTest.java (original)
+++ pdfbox/tags/1.5.0/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDSimpleFontTest.java Tue Jun 28 23:06:53 2011
@@ -53,7 +53,7 @@ public class PDSimpleFontTest {
     }
 
     /**
-     * Test of getawtFont method, of class PDSimpleFont.
+     * Test of the error reported in PDFBox-998
      */
     @Test
     public void testPDFBox988() throws Exception {
@@ -70,4 +70,23 @@ public class PDSimpleFontTest {
             }
         }
     }
+
+    /**
+     * Test of the error reported in PDFBox-1019
+     */
+    @Test
+    public void testPDFBox1019() throws Exception {
+        PDDocument doc = null;
+        try {
+           doc = PDDocument.load(PDSimpleFontTest.class.getResourceAsStream("256.pdf"));
+           List pages = doc.getDocumentCatalog().getAllPages();
+           PDPage page = (PDPage)pages.get(0);
+           BufferedImage image = page.convertToImage();
+           // The alligation is that convertToImage() will crash the JVM or hang
+        } finally {
+            if(doc != null) {
+                doc.close();
+            }
+        }
+    }
 }
\ No newline at end of file