Package org.jpedal.io

Examples of org.jpedal.io.PdfFileReader


    /**
        * read the form data from the file
        */
       final public PdfFileInformation readPdfFileMetadata(PdfObject metadataObj,PdfObjectReader currentPdfFile) {

           PdfFileReader objectReader=currentPdfFile.getObjectReader();
           ObjectDecoder objectDecoder=new ObjectDecoder(currentPdfFile.getObjectReader());

           //read info object (may be defined and object set in different trailers so must be done at end)
           DecryptionFactory decryption=objectReader.getDecryptionObject();
           PdfObject infoObject=objectReader.getInfoObject();
           if(infoObject!=null &&(!(decryption!=null && (decryption.getBooleanValue(PDFflags.IS_FILE_ENCRYPTED) || decryption.getBooleanValue(PDFflags.IS_PASSWORD_SUPPLIED)))))
               readInformationObject(infoObject,objectDecoder);

           //read and set XML value
           if(metadataObj!=null){

               String objectRef=new String(metadataObj.getUnresolvedData());

               //byte[] stream= metadataObj.DecodedStream;

               //start old
               //get data
               MetadataObject oldMetaDataObj =new MetadataObject(objectRef);
               objectReader.readObject(oldMetaDataObj);
               byte[] oldstream= oldMetaDataObj.getDecodedStream();
               /** breaks on encrypted (ie preptool)
                boolean failed=PdfReader.checkStreamsIdentical(stream,oldstream);

                if(failed)
View Full Code Here


    /**used for opening encrypted file*/
    PrivateKey key;

    public boolean isFileViewable(PdfObjectReader currentPdfFile) {
        if (currentPdfFile != null){
            PdfFileReader objectReader=currentPdfFile.getObjectReader();

            DecryptionFactory decryption=objectReader.getDecryptionObject();
            return decryption==null || decryption.getBooleanValue(PDFflags.IS_FILE_VIEWABLE) || certificate!=null;
        }else
            return false;
    }
View Full Code Here

    }

    public boolean isPasswordSupplied(PdfObjectReader currentPdfFile) {
        //allow through if user has verified password or set certificate
        if (currentPdfFile != null){
            PdfFileReader objectReader=currentPdfFile.getObjectReader();

            DecryptionFactory decryption=objectReader.getDecryptionObject();
            return decryption!=null && (decryption.getBooleanValue(PDFflags.IS_PASSWORD_SUPPLIED) || certificate!=null);
        }else
            return false;
    }
View Full Code Here

TOP

Related Classes of org.jpedal.io.PdfFileReader

Copyright © 2018 www.massapicom. 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.