Package com.lowagie.text.exceptions

Examples of com.lowagie.text.exceptions.BadPasswordException


        addDocument(reader);
    }
   
    void addDocument(PdfReader reader) throws DocumentException, IOException {
        if (!reader.isOpenedWithFullPermissions())
            throw new BadPasswordException(MessageLocalization.getComposedMessage("pdfreader.not.opened.with.owner.password"));
        openDoc();
        if (readers2intrefs.containsKey(reader)) {
            reader = new PdfReader(reader);
        }
        else {
View Full Code Here


     * @throws IOException
     */
    PdfStamperImp(PdfReader reader, OutputStream os, char pdfVersion, boolean append) throws DocumentException, IOException {
        super(new PdfDocument(), os);
        if (!reader.isOpenedWithFullPermissions())
            throw new BadPasswordException(MessageLocalization.getComposedMessage("pdfreader.not.opened.with.owner.password"));
        if (reader.isTampered())
            throw new DocumentException(MessageLocalization.getComposedMessage("the.original.document.was.reused.read.it.again.from.file"));
        reader.setTampered(true);
        this.reader = reader;
        file = reader.getSafeFile();
View Full Code Here

            try {
                readDocObj();
            }
            catch (Exception e) {
              if (e instanceof BadPasswordException)
                throw new BadPasswordException(e.getMessage());
                if (rebuilt || encryptionError)
                    throw new InvalidPdfException(e.getMessage());
                rebuilt = true;
                encrypted = false;
                rebuildXref();
View Full Code Here

            decrypt.setupByOwnerPassword(documentID, password, uValue, oValue, pValue);
            if (!equalsArray(uValue, decrypt.userKey, (rValue == 3 || rValue == 4) ? 16 : 32)) {
                //check by user password
                decrypt.setupByUserPassword(documentID, password, oValue, pValue);
                if (!equalsArray(uValue, decrypt.userKey, (rValue == 3 || rValue == 4) ? 16 : 32)) {
                    throw new BadPasswordException(MessageLocalization.getComposedMessage("bad.user.password"));
                }
            }
            else
                ownerPasswordUsed = true;
        }
View Full Code Here

            try {
                readDocObj();
            }
            catch (Exception e) {
              if (e instanceof BadPasswordException)
                throw new BadPasswordException(e.getMessage());
                if (rebuilt || encryptionError)
                    throw new InvalidPdfException(e.getMessage());
                rebuilt = true;
                encrypted = false;
                rebuildXref();
View Full Code Here

            decrypt.setupByOwnerPassword(documentID, password, uValue, oValue, pValue);
            if (!equalsArray(uValue, decrypt.userKey, (rValue == 3 || rValue == 4) ? 16 : 32)) {
                //check by user password
                decrypt.setupByUserPassword(documentID, password, oValue, pValue);
                if (!equalsArray(uValue, decrypt.userKey, (rValue == 3 || rValue == 4) ? 16 : 32)) {
                    throw new BadPasswordException("Bad user password");
                }
            }
            else
                ownerPasswordUsed = true;
        }
View Full Code Here

        addDocument(reader);
    }
   
    void addDocument(PdfReader reader) throws DocumentException, IOException {
        if (!reader.isOpenedWithFullPermissions())
            throw new BadPasswordException("PdfReader not opened with owner password");
        openDoc();
        if (readers2intrefs.containsKey(reader)) {
            reader = new PdfReader(reader);
        }
        else {
View Full Code Here

     * @throws IOException
     */
    PdfStamperImp(PdfReader reader, OutputStream os, char pdfVersion, boolean append) throws DocumentException, IOException {
        super(new PdfDocument(), os);
        if (!reader.isOpenedWithFullPermissions())
            throw new BadPasswordException("PdfReader not opened with owner password");
        if (reader.isTampered())
            throw new DocumentException("The original document was reused. Read it again from file.");
        reader.setTampered(true);
        this.reader = reader;
        file = reader.getSafeFile();
View Full Code Here

        addDocument(reader);
    }
   
    void addDocument(PdfReader reader) throws DocumentException, IOException {
        if (!reader.isOpenedWithFullPermissions())
            throw new BadPasswordException(MessageLocalization.getComposedMessage("pdfreader.not.opened.with.owner.password"));
        openDoc();
        if (readers2intrefs.containsKey(reader)) {
            reader = new PdfReader(reader);
        }
        else {
View Full Code Here

     * @throws IOException
     */
    PdfStamperImp(PdfReader reader, OutputStream os, char pdfVersion, boolean append) throws DocumentException, IOException {
        super(new PdfDocument(), os);
        if (!reader.isOpenedWithFullPermissions())
            throw new BadPasswordException(MessageLocalization.getComposedMessage("pdfreader.not.opened.with.owner.password"));
        if (reader.isTampered())
            throw new DocumentException(MessageLocalization.getComposedMessage("the.original.document.was.reused.read.it.again.from.file"));
        reader.setTampered(true);
        this.reader = reader;
        file = reader.getSafeFile();
View Full Code Here

TOP

Related Classes of com.lowagie.text.exceptions.BadPasswordException

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.