pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1674944 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
Date Mon, 20 Apr 2015 17:01:56 GMT
Author: tilman
Date: Mon Apr 20 17:01:56 2015
New Revision: 1674944

URL: http://svn.apache.org/r1674944
Log:
PDFBOX-2766: add missing load() method suggested by Jesse Long

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java?rev=1674944&r1=1674943&r2=1674944&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java Mon Apr 20
17:01:56 2015
@@ -875,6 +875,24 @@ public class PDDocument implements Close
      * 
      * @param input stream that contains the document.
      * @param password password to be used for decryption
+     * @param useScratchFiles enables the usage of a scratch file if set to true
+     * 
+     * @return loaded document
+     * 
+     * @throws IOException in case of a file reading or parsing error
+     */
+    public static PDDocument load(InputStream input, String password, boolean useScratchFiles)
throws IOException
+    {
+        PDFParser parser = new PDFParser(input, password, null, null, useScratchFiles);
+        parser.parse();
+        return parser.getPDDocument();
+    }
+    
+    /**
+     * Parses PDF with non sequential parser.
+     * 
+     * @param input stream that contains the document.
+     * @param password password to be used for decryption
      * @param keyStore key store to be used for decryption when using public key security

      * @param alias alias to be used for decryption when using public key security
      * @param useScratchFiles enables the usage of a scratch file if set to true



Mime
View raw message