You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2017/10/23 20:18:12 UTC
svn commit: r1813082 -
/pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdfparser/TestPDFParser.java
Author: tilman
Date: Mon Oct 23 20:18:12 2017
New Revision: 1813082
URL: http://svn.apache.org/viewvc?rev=1813082&view=rev
Log:
PDFBOX-3974: add test for PDFBOX-3977
Modified:
pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdfparser/TestPDFParser.java
Modified: pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdfparser/TestPDFParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdfparser/TestPDFParser.java?rev=1813082&r1=1813081&r2=1813082&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdfparser/TestPDFParser.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/test/java/org/apache/pdfbox/pdfparser/TestPDFParser.java Mon Oct 23 20:18:12 2017
@@ -424,6 +424,39 @@ public class TestPDFParser
}
/**
+ * Test whether /Info dictionary is retrieved correctly in brute force search for the
+ * Info/Catalog dictionaries.
+ *
+ * @throws MalformedURLException
+ * @throws IOException
+ */
+ @Test
+ public void testPDFBox3977() throws MalformedURLException, IOException
+ {
+ byte[] byteArray;
+ try
+ {
+ InputStream is = new URL("https://issues.apache.org/jira/secure/attachment/12893582/63NGFQRI44HQNPIPEJH5W2TBM6DJZWMI.pdf").openStream();
+ byteArray = IOUtils.toByteArray(is);
+ is.close();
+ }
+ catch (IOException ex)
+ {
+ System.err.println("URL loading failed, testPDFBox3977 will be skipped");
+ return;
+ }
+
+ PDDocument doc = PDDocument.load(byteArray);
+ PDDocumentInformation di = doc.getDocumentInformation();
+ assertEquals("QuarkXPress(tm) 6.52", di.getCreator());
+ assertEquals("Acrobat Distiller 7.0 pour Macintosh", di.getProducer());
+ assertEquals("Fich sal Fabr corr1 (Page 6)", di.getTitle());
+ assertEquals(DateConverter.toCalendar("D:20070608151915+02'00'"), di.getCreationDate());
+ assertEquals(DateConverter.toCalendar("D:20080604152122+02'00'"), di.getModificationDate());
+ doc.close();
+ }
+
+ /**
* Test parsing the "genko_oc_shiryo1.pdf" file, which is susceptible to regression.
*
* @throws Exception