pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1640553 - in /pdfbox/trunk: examples/src/main/java/org/apache/pdfbox/examples/signature/ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/digitalsignature/visible/ pdfbox/src/main/j...
Date Wed, 19 Nov 2014 13:53:21 GMT
Author: lehmi
Date: Wed Nov 19 13:53:20 2014
New Revision: 1640553

URL: http://svn.apache.org/r1640553
Log:
PDFBOX-2430: load() -> loadLegacy(), removed load(URL) and load(String) variants

Modified:
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignature.java
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateVisibleSignature.java
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/digitalsignature/visible/PDVisibleSignDesigner.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFHighlighter.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFMergerUtility.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestPublicKeyEncryption.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestSymmetricKeyEncryption.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestFDF.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocument.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocumentCatalog.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocumentInformation.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/TestEmbeddedFiles.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/TestOptionalContentGroups.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/PDFCloneUtilityTest.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/PageExtractorTest.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestLayerUtility.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestPDFToImage.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestRendering.java
    pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestTextStripper.java
    pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Decrypt.java
    pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Encrypt.java
    pdfbox/trunk/tools/src/test/java/org/apache/pdfbox/tools/imageio/TestImageIOUtils.java

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignature.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignature.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignature.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignature.java
Wed Nov 19 13:53:20 2014
@@ -151,7 +151,7 @@ public class CreateSignature implements 
         FileOutputStream fos = new FileOutputStream(outFile);
 
         // sign
-        PDDocument doc = PDDocument.load(inFile);
+        PDDocument doc = PDDocument.loadLegacy(inFile);
         signDetached(doc, fos, tsaClient);
         doc.close();
     }

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateVisibleSignature.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateVisibleSignature.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateVisibleSignature.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateVisibleSignature.java
Wed Nov 19 13:53:20 2014
@@ -129,7 +129,7 @@ public class CreateVisibleSignature impl
         fis = new FileInputStream(outputDocument);
 
         // load document
-        PDDocument doc = PDDocument.load(document);
+        PDDocument doc = PDDocument.loadLegacy(document);
 
         // create signature dictionary
         PDSignature signature = new PDSignature();

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/ShowSignature.java
Wed Nov 19 13:53:20 2014
@@ -17,18 +17,16 @@
 package org.apache.pdfbox.examples.signature;
 
 import java.io.ByteArrayInputStream;
+import java.io.File;
 import java.io.IOException;
-
 import java.security.cert.CertificateException;
 import java.security.cert.CertificateFactory;
-
 import java.util.Collection;
 
 import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSName;
 import org.apache.pdfbox.cos.COSString;
-
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.pdfbox.pdmodel.encryption.StandardDecryptionMaterial;
 
@@ -70,7 +68,7 @@ public class ShowSignature
             PDDocument document = null;
             try
             {
-                document = PDDocument.load( infile );
+                document = PDDocument.loadLegacy( new File(infile) );
 
                 if( document.isEncrypted() )
                 {

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=1640553&r1=1640552&r2=1640553&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 Wed Nov 19
13:53:20 2014
@@ -792,100 +792,6 @@ public class PDDocument implements Close
     }
 
     /**
-     * This will load a document from a url.
-     * 
-     * @param url The url to load the PDF from.
-     * 
-     * @return The document that was loaded.
-     * 
-     * @throws IOException If there is an error reading from the stream.
-     */
-    public static PDDocument load(URL url) throws IOException
-    {
-        return load(url.openStream());
-    }
-
-    /**
-     * This will load a document from a url. Used for skipping corrupt pdf objects
-     * 
-     * @param url The url to load the PDF from.
-     * @param force When true, the parser will skip corrupt pdf objects and will continue
parsing at the next object in
-     *            the file
-     * 
-     * @return The document that was loaded.
-     * 
-     * @throws IOException If there is an error reading from the stream.
-     */
-    public static PDDocument load(URL url, boolean force) throws IOException
-    {
-        return load(url.openStream(), force);
-    }
-
-    /**
-     * This will load a document from a url. Used for skipping corrupt pdf objects
-     * 
-     * @param url The url to load the PDF from.
-     * @param force When true, the parser will skip corrupt pdf objects and will continue
parsing at the next object in
-     *            the file
-     * @param useScratchFiles enables the usage of a scratch file if set to true
-     * 
-     * @return The document that was loaded.
-     * 
-     * @throws IOException If there is an error reading from the stream.
-     */
-    public static PDDocument load(URL url, boolean force, boolean useScratchFiles) throws
IOException
-    {
-        return load(url.openStream(), force, useScratchFiles);
-    }
-
-    /**
-     * This will load a document from a file.
-     * 
-     * @param filename The name of the file to load.
-     * 
-     * @return The document that was loaded.
-     * 
-     * @throws IOException If there is an error reading from the stream.
-     */
-    public static PDDocument load(String filename) throws IOException
-    {
-        return load(new File(filename));
-    }
-
-    /**
-     * This will load a document from a file. Allows for skipping corrupt pdf objects
-     * 
-     * @param filename The name of the file to load.
-     * @param force When true, the parser will skip corrupt pdf objects and will continue
parsing at the next object in
-     *            the file
-     * 
-     * @return The document that was loaded.
-     * 
-     * @throws IOException If there is an error reading from the stream.
-     */
-    public static PDDocument load(String filename, boolean force) throws IOException
-    {
-        return load(new File(filename), force);
-    }
-
-    /**
-     * This will load a document from a file. Allows for skipping corrupt pdf objects
-     * 
-     * @param filename The name of the file to load.
-     * @param force When true, the parser will skip corrupt pdf objects and will continue
parsing at the next object in
-     *            the file
-     * @param useScratchFiles enables the usage of a scratch file if set to true
-     * 
-     * @return The document that was loaded.
-     * 
-     * @throws IOException If there is an error reading from the stream.
-     */
-    public static PDDocument load(String filename, boolean force, boolean useScratchFiles)
throws IOException
-    {
-        return load(new File(filename), force, useScratchFiles);
-    }
-
-    /**
      * This will load a document from a file.
      * 
      * @param file The name of the file to load.
@@ -894,9 +800,9 @@ public class PDDocument implements Close
      * 
      * @throws IOException If there is an error reading from the stream.
      */
-    public static PDDocument load(File file) throws IOException
+    public static PDDocument loadLegacy(File file) throws IOException
     {
-        return load(file, BaseParser.FORCE_PARSING, false);
+        return loadLegacy(file, BaseParser.FORCE_PARSING, false);
     }
 
     /**
@@ -910,9 +816,9 @@ public class PDDocument implements Close
      *
      * @throws IOException If there is an error reading from the stream.
      */
-    public static PDDocument load(File file, boolean force) throws IOException
+    public static PDDocument loadLegacy(File file, boolean force) throws IOException
     {
-        return load(file, force , false);
+        return loadLegacy(file, force , false);
     }
 
     /**
@@ -927,7 +833,7 @@ public class PDDocument implements Close
      *
      * @throws IOException If there is an error reading from the stream.
      */
-    public static PDDocument load(File file, boolean force, boolean useScratchFiles) throws
IOException
+    public static PDDocument loadLegacy(File file, boolean force, boolean useScratchFiles)
throws IOException
     {
         PDFParser parser = new PDFParser(new FileInputStream(file), force, useScratchFiles);
         parser.parse();
@@ -945,9 +851,9 @@ public class PDDocument implements Close
      * 
      * @throws IOException If there is an error reading from the stream.
      */
-    public static PDDocument load(InputStream input) throws IOException
+    public static PDDocument loadLegacy(InputStream input) throws IOException
     {
-        return load(input, BaseParser.FORCE_PARSING, false);
+        return loadLegacy(input, BaseParser.FORCE_PARSING, false);
     }
 
     /**
@@ -961,9 +867,9 @@ public class PDDocument implements Close
      * 
      * @throws IOException If there is an error reading from the stream.
      */
-    public static PDDocument load(InputStream input, boolean force) throws IOException
+    public static PDDocument loadLegacy(InputStream input, boolean force) throws IOException
     {
-        return load(input, force, false);
+        return loadLegacy(input, force, false);
     }
 
     /**
@@ -978,7 +884,7 @@ public class PDDocument implements Close
      * 
      * @throws IOException If there is an error reading from the stream.
      */
-    public static PDDocument load(InputStream input, boolean force, boolean useScratchFiles)
throws IOException
+    public static PDDocument loadLegacy(InputStream input, boolean force, boolean useScratchFiles)
throws IOException
     {
         PDFParser parser = new PDFParser(input, force, useScratchFiles);
         parser.parse();

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/digitalsignature/visible/PDVisibleSignDesigner.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/digitalsignature/visible/PDVisibleSignDesigner.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/digitalsignature/visible/PDVisibleSignDesigner.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/digitalsignature/visible/PDVisibleSignDesigner.java
Wed Nov 19 13:53:20 2014
@@ -76,7 +76,7 @@ public class PDVisibleSignDesigner
         signatureImageStream(jpegStream);
 
         // create PD document
-        PDDocument document = PDDocument.load(documentStream);
+        PDDocument document = PDDocument.loadLegacy(documentStream);
 
         // calculate height an width of document
         calculatePageSize(document, page);

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFHighlighter.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFHighlighter.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFHighlighter.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFHighlighter.java Wed Nov 19
13:53:20 2014
@@ -17,6 +17,7 @@
 package org.apache.pdfbox.util;
 
 import java.io.ByteArrayOutputStream;
+import java.io.File;
 import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.io.Writer;
@@ -31,8 +32,7 @@ import org.apache.pdfbox.pdmodel.PDPage;
  * Highlighting of words in a PDF document with an XML file.
  *
  * @author slagraulet (slagraulet@cardiweb.com)
- * @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>
- * @version $Revision: 1.7 $
+ * @author Ben Litchfield
  *
  * @see <a href="http://partners.adobe.com/public/developer/en/pdf/HighlightFileFormat.pdf">
  *      Adobe Highlight File Format</a>
@@ -156,7 +156,7 @@ public class PDFHighlighter extends PDFT
             }
             String[] highlightStrings = new String[ args.length - 1];
             System.arraycopy( args, 1, highlightStrings, 0, highlightStrings.length );
-            doc = PDDocument.load( args[0] );
+            doc = PDDocument.loadNonSeq( new File(args[0]) );
 
             xmlExtractor.generateXMLHighlight(
                 doc,

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFMergerUtility.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFMergerUtility.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFMergerUtility.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/PDFMergerUtility.java Wed Nov
19 13:53:20 2014
@@ -58,7 +58,7 @@ import org.apache.pdfbox.pdmodel.interac
  * This class will take a list of pdf documents and merge them, saving the
  * result in a new document.
  *
- * @author <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>
+ * @author Ben Litchfield
  *
  */
 public class PDFMergerUtility
@@ -210,7 +210,7 @@ public class PDFMergerUtility
                     }
                     else
                     {
-                        source = PDDocument.load(sourceFile);
+                        source = PDDocument.loadLegacy(sourceFile);
                     }
 
                     tobeclosed.add(source);

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestPublicKeyEncryption.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestPublicKeyEncryption.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestPublicKeyEncryption.java
(original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestPublicKeyEncryption.java
Wed Nov 19 13:53:20 2014
@@ -100,7 +100,7 @@ public class TestPublicKeyEncryption ext
             TestPublicKeyEncryption.class.getResourceAsStream("test.pdf");
         try 
         {
-            document = PDDocument.load(input);
+            document = PDDocument.loadLegacy(input);
         } 
         finally 
         {
@@ -257,7 +257,7 @@ public class TestPublicKeyEncryption ext
     {
         ByteArrayOutputStream buffer = new ByteArrayOutputStream();
         doc.save(buffer);
-        return PDDocument.load(new ByteArrayInputStream(buffer.toByteArray()));
+        return PDDocument.loadLegacy(new ByteArrayInputStream(buffer.toByteArray()));
     }
 
     /**

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestSymmetricKeyEncryption.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestSymmetricKeyEncryption.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestSymmetricKeyEncryption.java
(original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestSymmetricKeyEncryption.java
Wed Nov 19 13:53:20 2014
@@ -208,7 +208,7 @@ public class TestSymmetricKeyEncryption 
         }
         else
         {
-            doc = PDDocument.load(new ByteArrayInputStream(inputFileAsByteArray));
+            doc = PDDocument.loadLegacy(new ByteArrayInputStream(inputFileAsByteArray));
             Assert.assertTrue(doc.isEncrypted());
             DecryptionMaterial decryptionMaterial = new StandardDecryptionMaterial(password);
             doc.openProtection(decryptionMaterial);
@@ -296,7 +296,7 @@ public class TestSymmetricKeyEncryption 
             String userpassword, String ownerpassword,
             AccessPermission permission, boolean nonSeq) throws IOException
     {
-        PDDocument document = PDDocument.load(new ByteArrayInputStream(inputFileAsByteArray));
+        PDDocument document = PDDocument.loadLegacy(new ByteArrayInputStream(inputFileAsByteArray));
         String prefix = "Simple-";
         int numSrcPages = document.getNumberOfPages();
         PDFRenderer pdfRenderer = new PDFRenderer(document);
@@ -371,7 +371,7 @@ public class TestSymmetricKeyEncryption 
         }
         else
         {
-            encryptedDoc = PDDocument.load(pdfFile);
+            encryptedDoc = PDDocument.loadLegacy(pdfFile);
             Assert.assertTrue(encryptedDoc.isEncrypted());
             DecryptionMaterial decryptionMaterial = new StandardDecryptionMaterial(ownerpassword);
             encryptedDoc.openProtection(decryptionMaterial);
@@ -386,7 +386,7 @@ public class TestSymmetricKeyEncryption 
         }
         else
         {
-            encryptedDoc = PDDocument.load(pdfFile);
+            encryptedDoc = PDDocument.loadLegacy(pdfFile);
             Assert.assertTrue(encryptedDoc.isEncrypted());
             DecryptionMaterial decryptionMaterial = new StandardDecryptionMaterial(userpassword);
             encryptedDoc.openProtection(decryptionMaterial);
@@ -402,7 +402,7 @@ public class TestSymmetricKeyEncryption 
     private File extractEmbeddedFile(InputStream pdfInputStream, String name) throws IOException
     {
         PDDocument docWithEmbeddedFile;
-        docWithEmbeddedFile = PDDocument.load(pdfInputStream);
+        docWithEmbeddedFile = PDDocument.loadLegacy(pdfInputStream);
         PDDocumentCatalog catalog = docWithEmbeddedFile.getDocumentCatalog();
         PDDocumentNameDictionary names = catalog.getNames();
         PDEmbeddedFilesNameTreeNode embeddedFiles = names.getEmbeddedFiles();
@@ -431,7 +431,7 @@ public class TestSymmetricKeyEncryption 
             File embeddedFilePriorToEncryption, boolean nonSeq,
             String userpassword, String ownerpassword) throws IOException
     {
-        PDDocument document = PDDocument.load(new ByteArrayInputStream(inputFileWithEmbeddedFileAsByteArray));
+        PDDocument document = PDDocument.loadLegacy(new ByteArrayInputStream(inputFileWithEmbeddedFileAsByteArray));
         PDDocument encryptedDoc = encrypt(keyLength, sizePriorToEncr, document, "ContainsEmbedded-",
permission, nonSeq, userpassword, ownerpassword);
 
         File decryptedFile = new File(testResultsDir, "DecryptedContainsEmbedded-" + keyLength
+ "-bit.pdf");

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestFDF.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestFDF.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestFDF.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestFDF.java Wed Nov 19 13:53:20
2014
@@ -98,7 +98,7 @@ public class TestFDF extends TestCase
             PDDocument fdeb = null;
             try
             {
-                fdeb = PDDocument.load( filePDF );
+                fdeb = PDDocument.loadLegacy( filePDF );
                 PDAcroForm form = fdeb.getDocumentCatalog().getAcroForm();
                 PDTextField field = (PDTextField)form.getField( "f67_1" );
                 field.setValue( "2" );
@@ -139,7 +139,7 @@ public class TestFDF extends TestCase
             PDDocument fdeb = null;
             try
             {
-                fdeb = PDDocument.load( filePDF );
+                fdeb = PDDocument.loadLegacy( filePDF );
                 PDAcroForm form = fdeb.getDocumentCatalog().getAcroForm();
                 PDTextField feld2 = (PDTextField)form.getField( "Feld.2" );
                 feld2.setValue( "Benjamin" );
@@ -210,7 +210,7 @@ public class TestFDF extends TestCase
             FDFDocument fdf = null;
             try
             {
-                freedom = PDDocument.load( filePDF );
+                freedom = PDDocument.loadLegacy( filePDF );
                 fdf = FDFDocument.load( fileFDF );
                 PDAcroForm form = freedom.getDocumentCatalog().getAcroForm();
                 form.importFDF( fdf );

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocument.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocument.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocument.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocument.java Wed Nov
19 13:53:20 2014
@@ -64,7 +64,7 @@ public class TestPDDocument extends Test
         assertEquals("%%EOF\n", new String(Arrays.copyOfRange(pdf, pdf.length - 6, pdf.length),
"UTF-8"));
 
         // Load
-        PDDocument loadDoc = PDDocument.load(new ByteArrayInputStream(pdf));
+        PDDocument loadDoc = PDDocument.loadLegacy(new ByteArrayInputStream(pdf));
         assertEquals(1, loadDoc.getNumberOfPages());
         loadDoc.close();
     }
@@ -93,7 +93,7 @@ public class TestPDDocument extends Test
         assertEquals("%%EOF\n", new String(Arrays.copyOfRange(pdf, pdf.length - 6, pdf.length),
"UTF-8"));
 
         // Load
-        PDDocument loadDoc = PDDocument.load(targetFile);
+        PDDocument loadDoc = PDDocument.loadLegacy(targetFile);
         assertEquals(1, loadDoc.getNumberOfPages());
         loadDoc.close();
     }

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocumentCatalog.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocumentCatalog.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocumentCatalog.java
(original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocumentCatalog.java
Wed Nov 19 13:53:20 2014
@@ -28,7 +28,7 @@ public class TestPDDocumentCatalog exten
     public void testPageLabels() throws Exception {
         PDDocument doc = null;
         try {
-            doc = PDDocument.load(TestPDDocumentCatalog.class.getResourceAsStream("test_pagelabels.pdf"));
+            doc = PDDocument.loadLegacy(TestPDDocumentCatalog.class.getResourceAsStream("test_pagelabels.pdf"));
             PDDocumentCatalog cat = doc.getDocumentCatalog();
             String[] labels = cat.getPageLabels().getLabelsByPageIndices();
             assertEquals(12, labels.length);
@@ -58,7 +58,7 @@ public class TestPDDocumentCatalog exten
     public void testLabelsOnMalformedPdf() throws Exception {
         PDDocument doc = null;
         try {
-            doc = PDDocument.load(TestPDDocumentCatalog.class.getResourceAsStream("page_label.pdf"));
+            doc = PDDocument.loadLegacy(TestPDDocumentCatalog.class.getResourceAsStream("page_label.pdf"));
             PDDocumentCatalog cat = doc.getDocumentCatalog();
             // getLabelsByPageIndices() should not throw an exception
             cat.getPageLabels().getLabelsByPageIndices();
@@ -79,7 +79,7 @@ public class TestPDDocumentCatalog exten
     public void testGetNumberOfPages() throws Exception {
         PDDocument doc = null;
         try {
-            doc = PDDocument.load(TestPDDocumentCatalog.class.getResource("test.unc.pdf"));
+            doc = PDDocument.loadLegacy(TestPDDocumentCatalog.class.getResourceAsStream("test.unc.pdf"));
             assertEquals(4, doc.getNumberOfPages());
         } finally {
             if(doc != null)

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocumentInformation.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocumentInformation.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocumentInformation.java
(original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/TestPDDocumentInformation.java
Wed Nov 19 13:53:20 2014
@@ -16,6 +16,7 @@
  */
 package org.apache.pdfbox.pdmodel;
 
+import java.io.File;
 import java.util.Arrays;
 import java.util.List;
 
@@ -33,7 +34,7 @@ public class TestPDDocumentInformation e
         try
         {
            // This document has been selected for this test as it contains custom metadata.
-           doc = PDDocument.load( "src/test/resources/input/hello3.pdf");
+           doc = PDDocument.loadLegacy( new File("src/test/resources/input/hello3.pdf"));
            PDDocumentInformation info = doc.getDocumentInformation();
            
            assertEquals("Wrong author",            "Brian Carrier", info.getAuthor());

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/TestEmbeddedFiles.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/TestEmbeddedFiles.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/TestEmbeddedFiles.java
(original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/common/TestEmbeddedFiles.java
Wed Nov 19 13:53:20 2014
@@ -40,7 +40,7 @@ public class TestEmbeddedFiles extends T
         boolean ok = false;
         try
         {
-            PDDocument doc = PDDocument.load(TestEmbeddedFiles.class.getResourceAsStream(
+            PDDocument doc = PDDocument.loadLegacy(TestEmbeddedFiles.class.getResourceAsStream(
                 "null_PDComplexFileSpecification.pdf"));
 
             PDDocumentCatalog catalog = doc.getDocumentCatalog();
@@ -79,7 +79,7 @@ public class TestEmbeddedFiles extends T
         PDEmbeddedFile dosFile = null;
         PDEmbeddedFile unixFile = null;
 
-        PDDocument doc = PDDocument.load(TestEmbeddedFiles.class
+        PDDocument doc = PDDocument.loadLegacy(TestEmbeddedFiles.class
                 .getResourceAsStream("testPDF_multiFormatEmbFiles.pdf"));
 
         PDDocumentCatalog catalog = doc.getDocumentCatalog();

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/PDFontTest.java Wed Nov
19 13:53:20 2014
@@ -67,7 +67,7 @@ public class PDFontTest
         PDDocument doc = null;
         try
         {
-            doc = PDDocument.load(PDFontTest.class.getResourceAsStream("F001u_3_7j.pdf"));
+            doc = PDDocument.loadLegacy(PDFontTest.class.getResourceAsStream("F001u_3_7j.pdf"));
             PDFRenderer renderer = new PDFRenderer(doc);
             renderer.renderImage(0);
             // the allegation is that renderImage() will crash the JVM or hang
@@ -90,7 +90,7 @@ public class PDFontTest
         PDDocument doc = null;
         try
         {
-            doc = PDDocument.load(PDFontTest.class.getResourceAsStream("256.pdf"));
+            doc = PDDocument.loadLegacy(PDFontTest.class.getResourceAsStream("256.pdf"));
             PDFRenderer renderer = new PDFRenderer(doc);
             renderer.renderImage(0);
             // the allegation is that renderImage() will crash the JVM or hang

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/TestOptionalContentGroups.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/TestOptionalContentGroups.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/TestOptionalContentGroups.java
(original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/pdmodel/graphics/optionalcontent/TestOptionalContentGroups.java
Wed Nov 19 13:53:20 2014
@@ -166,7 +166,7 @@ public class TestOptionalContentGroups e
             testOCGGeneration();
         }
 
-        PDDocument doc = PDDocument.load(pdfFile);
+        PDDocument doc = PDDocument.loadLegacy(pdfFile);
         try
         {
             assertEquals("%PDF-1.5", doc.getDocument().getHeaderString());

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/PDFCloneUtilityTest.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/PDFCloneUtilityTest.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/PDFCloneUtilityTest.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/PDFCloneUtilityTest.java Wed
Nov 19 13:53:20 2014
@@ -88,9 +88,9 @@ public class PDFCloneUtilityTest extends
 
         // save and reload PDF, so that one can see that the files are legit
         dstDoc.save(TESTDIR + CLONEDST);
-        PDDocument.load(TESTDIR + CLONESRC).close();
+        PDDocument.loadLegacy(new File(TESTDIR + CLONESRC)).close();
         PDDocument.loadNonSeq(new File(TESTDIR + CLONESRC), null).close();
-        PDDocument.load(TESTDIR + CLONEDST).close();
+        PDDocument.loadLegacy(new File(TESTDIR + CLONEDST)).close();
         PDDocument.loadNonSeq(new File(TESTDIR + CLONEDST), null).close();
     }
 }

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/PageExtractorTest.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/PageExtractorTest.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/PageExtractorTest.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/PageExtractorTest.java Wed Nov
19 13:53:20 2014
@@ -16,10 +16,13 @@
  */
 package org.apache.pdfbox.util;
 
+import java.io.File;
 import java.io.IOException;
+
 import junit.framework.TestCase;
 import static junit.framework.TestCase.assertEquals;
 import static junit.framework.TestCase.fail;
+
 import org.apache.pdfbox.pdmodel.PDDocument;
 
 /**
@@ -62,10 +65,10 @@ public class PageExtractorTest extends T
         try {
             try {
                 // this should work for most users
-                sourcePdf = PDDocument.load("src/test/resources/input/cweb.pdf");
+                sourcePdf = PDDocument.loadLegacy(new File("src/test/resources/input/cweb.pdf"));
             } catch(IOException e) {
                 // in case your directory structure is different, just change this to be
the correct path
-                sourcePdf = PDDocument.load("pdfbox/pdfbox/src/test/resources/input/cweb.pdf");
+                sourcePdf = PDDocument.loadLegacy(new File("pdfbox/pdfbox/src/test/resources/input/cweb.pdf"));
             }
             PageExtractor instance = new PageExtractor(sourcePdf);
             result = instance.extract();

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestLayerUtility.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestLayerUtility.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestLayerUtility.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestLayerUtility.java Wed Nov
19 13:53:20 2014
@@ -64,8 +64,8 @@ public class TestLayerUtility extends Te
         File overlay1 = createOverlay1();
         File targetFile = new File(testResultsDir, "text-with-form-overlay.pdf");
 
-        PDDocument targetDoc = PDDocument.load(mainPDF);
-        PDDocument overlay1Doc = PDDocument.load(overlay1);
+        PDDocument targetDoc = PDDocument.loadNonSeq(mainPDF);
+        PDDocument overlay1Doc = PDDocument.loadNonSeq(overlay1);
         try
         {
             LayerUtility layerUtil = new LayerUtility(targetDoc);
@@ -87,7 +87,7 @@ public class TestLayerUtility extends Te
             overlay1Doc.close();
         }
 
-        PDDocument doc = PDDocument.load(targetFile);
+        PDDocument doc = PDDocument.loadLegacy(targetFile);
         try
         {
             PDDocumentCatalog catalog = doc.getDocumentCatalog();

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestPDFToImage.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestPDFToImage.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestPDFToImage.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestPDFToImage.java Wed Nov 19
13:53:20 2014
@@ -215,7 +215,7 @@ public class TestPDFToImage extends Test
             {
                 // Check for version difference between load() and loadNonSeq()
                 new FileOutputStream(new File(outDir + file.getName() + ".parseseqerror")).close();
-                PDDocument doc2 = PDDocument.load(file);
+                PDDocument doc2 = PDDocument.loadLegacy(file);
                 if (doc2.getDocument().getVersion() != document.getDocument().getVersion())
                 {
                     new FileOutputStream(new File(outDir + file.getName() + ".versiondiff")).close();

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestRendering.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestRendering.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestRendering.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestRendering.java Wed Nov 19
13:53:20 2014
@@ -73,7 +73,7 @@ public class TestRendering
     public void render() throws IOException
     {
         File file = new File(INPUT_DIR, fileName);
-        PDDocument document = PDDocument.load(file);
+        PDDocument document = PDDocument.loadLegacy(file);
         PDFRenderer renderer = new PDFRenderer(document);
         BufferedImage image = renderer.renderImage(0);
 

Modified: pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestTextStripper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestTextStripper.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestTextStripper.java (original)
+++ pdfbox/trunk/pdfbox/src/test/java/org/apache/pdfbox/util/TestTextStripper.java Wed Nov
19 13:53:20 2014
@@ -229,7 +229,7 @@ public class TestTextStripper extends Te
         }
 
         //System.out.println("  " + inFile + (bSort ? " (sorted)" : ""));
-        PDDocument document = PDDocument.load(inFile);
+        PDDocument document = PDDocument.loadLegacy(inFile);
         try
         {
             

Modified: pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Decrypt.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Decrypt.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Decrypt.java (original)
+++ pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Decrypt.java Wed Nov 19 13:53:20
2014
@@ -16,6 +16,7 @@
  */
 package org.apache.pdfbox.tools;
 
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.security.KeyStore;
@@ -32,8 +33,7 @@ import org.apache.pdfbox.pdmodel.encrypt
  *
  * usage: java org.apache.pdfbox.tools.Decrypt &lt;password&gt; &lt;inputfile&gt;
&lt;outputfile&gt;
  *
- * @author  <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>
- * @version $Revision: 1.5 $
+ * @author  Ben Litchfield
  */
 public class Decrypt
 {
@@ -133,7 +133,7 @@ public class Decrypt
 
             try
             {
-                document = PDDocument.load( infile );
+                document = PDDocument.loadLegacy( new File(infile) );
 
                 if( document.isEncrypted() )
                 {

Modified: pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Encrypt.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Encrypt.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Encrypt.java (original)
+++ pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/Encrypt.java Wed Nov 19 13:53:20
2014
@@ -16,6 +16,7 @@
  */
 package org.apache.pdfbox.tools;
 
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStream;
 import java.security.cert.CertificateFactory;
@@ -31,8 +32,7 @@ import org.apache.pdfbox.pdmodel.encrypt
  * This will read a document from the filesystem, encrypt it and and then write
  * the results to the filesystem. <br/><br/>
  *
- * @author  <a href="mailto:ben@benlitchfield.com">Ben Litchfield</a>
- * @version $Revision: 1.9 $
+ * @author  Ben Litchfield
  */
 public class Encrypt
 {
@@ -158,7 +158,7 @@ public class Encrypt
                 {
                     outfile = infile;
                 }
-                document = PDDocument.load( infile );
+                document = PDDocument.loadLegacy( new File(infile) );
 
                 if( !document.isEncrypted() )
                 {

Modified: pdfbox/trunk/tools/src/test/java/org/apache/pdfbox/tools/imageio/TestImageIOUtils.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/test/java/org/apache/pdfbox/tools/imageio/TestImageIOUtils.java?rev=1640553&r1=1640552&r2=1640553&view=diff
==============================================================================
--- pdfbox/trunk/tools/src/test/java/org/apache/pdfbox/tools/imageio/TestImageIOUtils.java
(original)
+++ pdfbox/trunk/tools/src/test/java/org/apache/pdfbox/tools/imageio/TestImageIOUtils.java
Wed Nov 19 13:53:20 2014
@@ -108,7 +108,7 @@ public class TestImageIOUtils extends Te
         try
         {
             float dpi = 36; // low DPI so that rendering is FAST
-            document = PDDocument.load(file);
+            document = PDDocument.loadLegacy(file);
 
             // Save image resources of first page
             checkSaveResources(document.getPage(0).getResources());



Mime
View raw message