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 2021/04/21 04:26:43 UTC

svn commit: r1889046 - /pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreatePortableCollection.java

Author: tilman
Date: Wed Apr 21 04:26:43 2021
New Revision: 1889046

URL: http://svn.apache.org/viewvc?rev=1889046&view=rev
Log:
PDFBOX-5164: remove jdk 1.7 class

Modified:
    pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreatePortableCollection.java

Modified: pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreatePortableCollection.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreatePortableCollection.java?rev=1889046&r1=1889045&r2=1889046&view=diff
==============================================================================
--- pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreatePortableCollection.java (original)
+++ pdfbox/branches/2.0/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreatePortableCollection.java Wed Apr 21 04:26:43 2021
@@ -18,7 +18,6 @@ package org.apache.pdfbox.examples.pdmod
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
-import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.GregorianCalendar;
 import java.util.HashMap;
@@ -36,6 +35,7 @@ import org.apache.pdfbox.pdmodel.PageMod
 import org.apache.pdfbox.pdmodel.common.filespecification.PDComplexFileSpecification;
 import org.apache.pdfbox.pdmodel.common.filespecification.PDEmbeddedFile;
 import org.apache.pdfbox.pdmodel.font.PDType1Font;
+import org.apache.pdfbox.util.Charsets;
 
 /**
  * This is an example on how to create a portable collection PDF, as described in the PDF 1.7
@@ -87,7 +87,7 @@ public class CreatePortableCollection
         fs1.setFileUnicode("Test1.txt");
 
         //create a dummy file stream, this would probably normally be a FileInputStream
-        byte[] data1 = "This is the contents of the first embedded file".getBytes(StandardCharsets.ISO_8859_1);
+        byte[] data1 = "This is the contents of the first embedded file".getBytes(Charsets.ISO_8859_1);
         PDEmbeddedFile ef1 = new PDEmbeddedFile(doc, new ByteArrayInputStream(data1), COSName.FLATE_DECODE);
         //now lets some of the optional parameters
         ef1.setSubtype("text/plain");
@@ -107,7 +107,7 @@ public class CreatePortableCollection
         fs2.setFileUnicode("Test2.txt");
 
         //create a dummy file stream, this would probably normally be a FileInputStream
-        byte[] data2 = "This is the contents of the second embedded file".getBytes(StandardCharsets.ISO_8859_1);
+        byte[] data2 = "This is the contents of the second embedded file".getBytes(Charsets.ISO_8859_1);
         PDEmbeddedFile ef2 = new PDEmbeddedFile(doc, new ByteArrayInputStream(data2), COSName.FLATE_DECODE);
         //now lets some of the optional parameters
         ef2.setSubtype("text/plain");