pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1601920 - in /pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples: fdf/ pdmodel/ util/
Date Wed, 11 Jun 2014 14:46:12 GMT
Author: tilman
Date: Wed Jun 11 14:46:12 2014
New Revision: 1601920

URL: http://svn.apache.org/r1601920
Log:
PDFBOX-1474: removed catch handler for non existant InvalidPasswordException

Modified:
    pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/fdf/PrintFields.java
    pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/fdf/SetField.java
    pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ExtractEmbeddedFiles.java
    pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ExtractMetadata.java
    pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/PrintBookmarks.java
    pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/PrintDocumentMetaData.java
    pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/ExtractTextByArea.java
    pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/PrintImageLocations.java
    pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/PrintTextLocations.java

Modified: pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/fdf/PrintFields.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/fdf/PrintFields.java?rev=1601920&r1=1601919&r2=1601920&view=diff
==============================================================================
--- pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/fdf/PrintFields.java
(original)
+++ pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/fdf/PrintFields.java
Wed Jun 11 14:46:12 2014
@@ -125,15 +125,7 @@ public class PrintFields
                 PrintFields exporter = new PrintFields();
                 if (pdf.isEncrypted())
                 {
-                    try
-                    {
-                        pdf.decrypt("");
-                    }
-                    catch (InvalidPasswordException e)
-                    {
-                        System.err.println("Error: The document is encrypted.");
-                        usage();
-                    }
+                    pdf.decrypt("");
                 }
                 exporter.printFields(pdf);
             }

Modified: pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/fdf/SetField.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/fdf/SetField.java?rev=1601920&r1=1601919&r2=1601920&view=diff
==============================================================================
--- pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/fdf/SetField.java
(original)
+++ pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/fdf/SetField.java
Wed Jun 11 14:46:12 2014
@@ -98,15 +98,7 @@ public class SetField extends AbstractEx
                 pdf = PDDocument.load( args[0] );
                 if (pdf.isEncrypted())
                 {
-                    try
-                    {
-                        pdf.decrypt("");
-                    }
-                    catch (InvalidPasswordException e)
-                    {
-                        System.err.println("Error: The document is encrypted.");
-                        usage();
-                    }
+                    pdf.decrypt("");
                 }
                 example.setField( pdf, args[1], args[2] );
                 pdf.save( args[0] );

Modified: pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ExtractEmbeddedFiles.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ExtractEmbeddedFiles.java?rev=1601920&r1=1601919&r2=1601920&view=diff
==============================================================================
--- pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ExtractEmbeddedFiles.java
(original)
+++ pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ExtractEmbeddedFiles.java
Wed Jun 11 14:46:12 2014
@@ -72,10 +72,6 @@ public class ExtractEmbeddedFiles
                     {
                         document.decrypt("");
                     }
-                    catch( InvalidPasswordException e )
-                    {
-                        System.err.println( "Error: The document is encrypted." );
-                    }
                     catch( org.apache.pdfbox.exceptions.CryptographyException e )
                     {
                         e.printStackTrace();

Modified: pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ExtractMetadata.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ExtractMetadata.java?rev=1601920&r1=1601919&r2=1601920&view=diff
==============================================================================
--- pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ExtractMetadata.java
(original)
+++ pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ExtractMetadata.java
Wed Jun 11 14:46:12 2014
@@ -73,10 +73,6 @@ public class ExtractMetadata
                     {
                         document.decrypt("");
                     }
-                    catch( InvalidPasswordException e )
-                    {
-                        System.err.println( "Error: The document is encrypted." );
-                    }
                     catch( org.apache.pdfbox.exceptions.CryptographyException e )
                     {
                         e.printStackTrace();

Modified: pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/PrintBookmarks.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/PrintBookmarks.java?rev=1601920&r1=1601919&r2=1601920&view=diff
==============================================================================
--- pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/PrintBookmarks.java
(original)
+++ pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/PrintBookmarks.java
Wed Jun 11 14:46:12 2014
@@ -63,15 +63,7 @@ public class PrintBookmarks
                 document = parser.getPDDocument();
                 if( document.isEncrypted() )
                 {
-                    try
-                    {
-                        document.decrypt( "" );
-                    }
-                    catch( InvalidPasswordException e )
-                    {
-                        System.err.println( "Error: Document is encrypted with a password."
);
-                        System.exit( 1 );
-                    }
+                    document.decrypt( "" );
                 }
                 PrintBookmarks meta = new PrintBookmarks();
                 PDDocumentOutline outline =  document.getDocumentCatalog().getDocumentOutline();

Modified: pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/PrintDocumentMetaData.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/PrintDocumentMetaData.java?rev=1601920&r1=1601919&r2=1601920&view=diff
==============================================================================
--- pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/PrintDocumentMetaData.java
(original)
+++ pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/PrintDocumentMetaData.java
Wed Jun 11 14:46:12 2014
@@ -67,15 +67,7 @@ public class PrintDocumentMetaData
                 document = parser.getPDDocument();
                 if( document.isEncrypted() )
                 {
-                    try
-                    {
-                        document.decrypt( "" );
-                    }
-                    catch( InvalidPasswordException e )
-                    {
-                        System.err.println( "Error: Document is encrypted with a password."
);
-                        System.exit( 1 );
-                    }
+                    document.decrypt( "" );
                 }
                 PrintDocumentMetaData meta = new PrintDocumentMetaData();
                 meta.printMetadata( document );

Modified: pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/ExtractTextByArea.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/ExtractTextByArea.java?rev=1601920&r1=1601919&r2=1601920&view=diff
==============================================================================
--- pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/ExtractTextByArea.java
(original)
+++ pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/ExtractTextByArea.java
Wed Jun 11 14:46:12 2014
@@ -63,15 +63,7 @@ public class ExtractTextByArea
                 document = PDDocument.load( args[0] );
                 if( document.isEncrypted() )
                 {
-                    try
-                    {
-                        document.decrypt( "" );
-                    }
-                    catch( InvalidPasswordException e )
-                    {
-                        System.err.println( "Error: Document is encrypted with a password."
);
-                        System.exit( 1 );
-                    }
+                    document.decrypt( "" );
                 }
                 PDFTextStripperByArea stripper = new PDFTextStripperByArea();
                 stripper.setSortByPosition( true );

Modified: pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/PrintImageLocations.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/PrintImageLocations.java?rev=1601920&r1=1601919&r2=1601920&view=diff
==============================================================================
--- pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/PrintImageLocations.java
(original)
+++ pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/PrintImageLocations.java
Wed Jun 11 14:46:12 2014
@@ -84,15 +84,7 @@ public class PrintImageLocations extends
                 document = PDDocument.load( args[0] );
                 if( document.isEncrypted() )
                 {
-                    try
-                    {
-                        document.decrypt( "" );
-                    }
-                    catch( InvalidPasswordException e )
-                    {
-                        System.err.println( "Error: Document is encrypted with a password."
);
-                        System.exit( 1 );
-                    }
+                    document.decrypt( "" );
                 }
                 PrintImageLocations printer = new PrintImageLocations();
                 List allPages = document.getDocumentCatalog().getAllPages();

Modified: pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/PrintTextLocations.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/PrintTextLocations.java?rev=1601920&r1=1601919&r2=1601920&view=diff
==============================================================================
--- pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/PrintTextLocations.java
(original)
+++ pdfbox/branches/1.8/examples/src/main/java/org/apache/pdfbox/examples/util/PrintTextLocations.java
Wed Jun 11 14:46:12 2014
@@ -70,15 +70,7 @@ public class PrintTextLocations extends 
                 document = PDDocument.load( args[0] );
                 if( document.isEncrypted() )
                 {
-                    try
-                    {
-                        document.decrypt( "" );
-                    }
-                    catch( InvalidPasswordException e )
-                    {
-                        System.err.println( "Error: Document is encrypted with a password."
);
-                        System.exit( 1 );
-                    }
+                    document.decrypt( "" );
                 }
                 PrintTextLocations printer = new PrintTextLocations();
                 List allPages = document.getDocumentCatalog().getAllPages();



Mime
View raw message