Examples of InvalidPdfException


Examples of com.itextpdf.text.exceptions.InvalidPdfException

                    break;
                }
                address = tokens.intValue() + first;
            }
            if (!ok)
                throw new InvalidPdfException(MessageLocalization.getComposedMessage("error.reading.objstm"));
            tokens.seek(address);
            tokens.nextToken();
            PdfObject obj;
            if (tokens.getTokenType() == PRTokeniser.TokenType.NUMBER) {
                obj = new PdfNumber(tokens.getStringValue());
View Full Code Here

Examples of com.itextpdf.text.exceptions.InvalidPdfException

                    break;
                }
                address[k] = tokens.intValue() + first;
            }
            if (!ok)
                throw new InvalidPdfException(MessageLocalization.getComposedMessage("error.reading.objstm"));
            for (int k = 0; k < n; ++k) {
                if (map.containsKey(k)) {
                    tokens.seek(address[k]);
                    tokens.nextToken();
                    PdfObject obj;
View Full Code Here

Examples of com.itextpdf.text.exceptions.InvalidPdfException

        hybridXref = false;
        newXrefType = false;
        tokens.seek(tokens.getStartxref());
        tokens.nextToken();
        if (!tokens.getStringValue().equals("startxref"))
            throw new InvalidPdfException(MessageLocalization.getComposedMessage("startxref.not.found"));
        tokens.nextToken();
        if (tokens.getTokenType() != TokenType.NUMBER)
            throw new InvalidPdfException(MessageLocalization.getComposedMessage("startxref.is.not.followed.by.a.number"));
        int startxref = tokens.intValue();
        lastXref = startxref;
        eofPos = tokens.getFilePointer();
        try {
            if (readXRefStream(startxref)) {
View Full Code Here

Examples of com.itextpdf.text.exceptions.InvalidPdfException

                    xr[num] = obj;
                }
            }
        }
        if (trailer == null)
            throw new InvalidPdfException(MessageLocalization.getComposedMessage("trailer.not.found"));
        xref = new int[top * 2];
        for (int k = 0; k < top; ++k) {
            int obj[] = xr[k];
            if (obj != null)
                xref[k * 2] = obj[0];
View Full Code Here

Examples of com.itextpdf.text.exceptions.InvalidPdfException

        if (ch != -1)
            file.pushBack((byte)ch);
    }
   
    public void throwError(String error) throws IOException {
        throw new InvalidPdfException(MessageLocalization.getComposedMessage("1.at.file.pointer.2", error, String.valueOf(file.getFilePointer())));
    }
View Full Code Here

Examples of com.itextpdf.text.exceptions.InvalidPdfException

    public char checkPdfHeader() throws IOException {
        file.setStartOffset(0);
        String str = readString(1024);
        int idx = str.indexOf("%PDF-");
        if (idx < 0)
            throw new InvalidPdfException(MessageLocalization.getComposedMessage("pdf.header.not.found"));
        file.setStartOffset(idx);
        return str.charAt(idx + 7);
    }
View Full Code Here

Examples of com.itextpdf.text.exceptions.InvalidPdfException

    public void checkFdfHeader() throws IOException {
        file.setStartOffset(0);
        String str = readString(1024);
        int idx = str.indexOf("%FDF-");
        if (idx < 0)
            throw new InvalidPdfException(MessageLocalization.getComposedMessage("fdf.header.not.found"));
        file.setStartOffset(idx);
    }
View Full Code Here

Examples of com.itextpdf.text.exceptions.InvalidPdfException

        int pos = file.length() - size;
        file.seek(pos);
        String str = readString(1024);
        int idx = str.lastIndexOf("startxref");
        if (idx < 0)
            throw new InvalidPdfException(MessageLocalization.getComposedMessage("pdf.startxref.not.found"));
        return pos + idx;
    }
View Full Code Here

Examples of com.itextpdf.text.exceptions.InvalidPdfException

        if (ch != -1)
            file.pushBack((byte)ch);
    }
   
    public void throwError(String error) throws IOException {
        throw new InvalidPdfException(MessageLocalization.getComposedMessage("1.at.file.pointer.2", error, String.valueOf(file.getFilePointer())));
    }
View Full Code Here

Examples of com.itextpdf.text.exceptions.InvalidPdfException

    public char checkPdfHeader() throws IOException {
        file.setStartOffset(0);
        String str = readString(1024);
        int idx = str.indexOf("%PDF-");
        if (idx < 0)
            throw new InvalidPdfException(MessageLocalization.getComposedMessage("pdf.header.not.found"));
        file.setStartOffset(idx);
        return str.charAt(idx + 7);
    }
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.