Examples of canExtractContent()


Examples of org.apache.pdfbox.pdmodel.encryption.AccessPermission.canExtractContent()

      if (document.isEncrypted()) {
        StandardDecryptionMaterial sdm = new StandardDecryptionMaterial(password);
        document.openProtection(sdm);
        AccessPermission ap = document.getCurrentAccessPermission();

        if (!ap.canExtractContent()) {
          throw new IOException("You do not have permission to extract text");
        }
      }

      if (toConsole) {
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.encryption.AccessPermission.canExtractContent()

                securityHandler = SecurityHandlersManager.getInstance().getSecurityHandler(encParameters.getFilter());
                securityHandler.prepareForDecryption(encParameters, document.getDocumentID(), decryptionMaterial);

                AccessPermission permission = securityHandler.getCurrentAccessPermission();
                if (!permission.canExtractContent())
                {
                    LOG.warn("PDF file '" + pdfFile.getPath() + "' does not allow extracting content.");
                }

            }
View Full Code Here

Examples of org.apache.pdfbox.pdmodel.encryption.AccessPermission.canExtractContent()

                {
                    StandardDecryptionMaterial sdm = new StandardDecryptionMaterial( password );
                    document.openProtection( sdm );
                    AccessPermission ap = document.getCurrentAccessPermission();

                    if( ! ap.canExtractContent() )
                    {
                        throw new IOException( "You do not have permission to extract text" );
                    }
                }
View Full Code Here

Examples of org.pdfbox.pdmodel.encryption.AccessPermission.canExtractContent()

        Assert.assertTrue(doc2.isEncrypted());
       
        AccessPermission currentAp = doc2.getCurrentAccessPermission();
       
        Assert.assertFalse(currentAp.canAssembleDocument());
        Assert.assertFalse(currentAp.canExtractContent());
        Assert.assertTrue(currentAp.canExtractForAccessibility());
        Assert.assertFalse(currentAp.canFillInForm());
        Assert.assertFalse(currentAp.canModify());
        Assert.assertFalse(currentAp.canModifyAnnotations());
        Assert.assertFalse(currentAp.canPrint());
View Full Code Here

Examples of org.pdfbox.pdmodel.encryption.AccessPermission.canExtractContent()

                        StandardDecryptionMaterial spm = new StandardDecryptionMaterial(password);
                        document.openProtection(spm);
                        AccessPermission ap = document.getCurrentAccessPermission();
                           
                       
                        if( ! ap.canExtractContent() )
                        {
                            throw new IOException(
                                "Error: You do not have permission to extract images." );
                        }
                    }
View Full Code Here

Examples of org.pdfbox.pdmodel.encryption.AccessPermission.canExtractContent()

                {
                    StandardDecryptionMaterial sdm = new StandardDecryptionMaterial( password );                   
                    document.openProtection( sdm );
                    AccessPermission ap = document.getCurrentAccessPermission();
                   
                    if( ! ap.canExtractContent() )
                    {
                        throw new IOException( "You do not have permission to extract text" );
                    }
                }
                if( toConsole )
View Full Code Here

Examples of org.pdfbox.pdmodel.encryption.AccessPermission.canExtractContent()

        try {
            document = getPDDocument();

            // check document is readable
            AccessPermission ap = document.getCurrentAccessPermission();
            if (! ap.canExtractContent()) {
                log.info("parse() Document (" + filename + ") isn't readable for DocSearcher.");
                throw new ConverterException("parse() can't read PDF file");
            }

            // write the text to temp file
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.