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 2019/03/16 13:30:06 UTC
svn commit: r1855644 -
/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/EmbeddedFiles.java
Author: tilman
Date: Sat Mar 16 13:30:06 2019
New Revision: 1855644
URL: http://svn.apache.org/viewvc?rev=1855644&view=rev
Log:
PDFBOX-4485: improve example for backwards, cross-platform and cross-language compatibility
Modified:
pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/EmbeddedFiles.java
Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/EmbeddedFiles.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/EmbeddedFiles.java?rev=1855644&r1=1855643&r2=1855644&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/EmbeddedFiles.java (original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/EmbeddedFiles.java Sat Mar 16 13:30:06 2019
@@ -80,7 +80,11 @@ public class EmbeddedFiles
//first create the file specification, which holds the embedded file
PDComplexFileSpecification fs = new PDComplexFileSpecification();
+
+ // use both methods for backwards, cross-platform and cross-language compatibility.
fs.setFile( "Test.txt" );
+ fs.setFileUnicode("Test.txt");
+
//create a dummy file stream, this would probably normally be a FileInputStream
byte[] data = "This is the contents of the embedded file".getBytes("ISO-8859-1");
ByteArrayInputStream fakeFile =