pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1759323 - /pdfbox/branches/1.8/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocument.java
Date Mon, 05 Sep 2016 16:11:54 GMT
Author: tilman
Date: Mon Sep  5 16:11:54 2016
New Revision: 1759323

URL: http://svn.apache.org/viewvc?rev=1759323&view=rev
Log:
PDFBOX-3481: add test

Modified:
    pdfbox/branches/1.8/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocument.java

Modified: pdfbox/branches/1.8/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocument.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocument.java?rev=1759323&r1=1759322&r2=1759323&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocument.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocument.java
Mon Sep  5 16:11:54 2016
@@ -24,6 +24,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.PrintWriter;
+import java.util.Locale;
 
 import org.apache.pdfbox.exceptions.COSVisitorException;
 import org.apache.pdfbox.io.IOUtils;
@@ -237,4 +238,27 @@ public class TestPDDocument extends Test
         boolean deleted = f.delete();
         assertTrue("delete good file failed after successful load() and close()", deleted);
     }
+
+    /**
+     * PDFBOX-3481: Test whether XRef generation results in unusable PDFs if Arab numbering
is
+     * default.
+     */
+    public void testSaveArabicLocale() throws IOException, COSVisitorException
+    {
+        Locale defaultLocale = Locale.getDefault();
+        Locale arabicLocale = new Locale.Builder().setLanguageTag("ar-EG-u-nu-arab").build();
+        Locale.setDefault(arabicLocale);
+
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+
+        PDDocument doc = new PDDocument();
+        doc.addPage(new PDPage());
+        doc.save(baos);
+        doc.close();
+
+        PDDocument.load(new ByteArrayInputStream(baos.toByteArray())).close();
+        PDDocument.loadNonSeq(new ByteArrayInputStream(baos.toByteArray()), null).close();
+
+        Locale.setDefault(defaultLocale);
+    }
 }



Mime
View raw message