Examples of InvalidPdfException


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

      String str = readString(1024);
        int idx = str.indexOf("%PDF-");
        if (idx < 0){
          idx = str.indexOf("%FDF-");
          if (idx < 0)
            throw new InvalidPdfException(MessageLocalization.getComposedMessage("pdf.header.not.found"));
        }

        return idx;
    }
View Full Code Here

Examples of com.itextpdf.text.exceptions.InvalidPdfException

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

Examples of com.itextpdf.text.exceptions.InvalidPdfException

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

Examples of com.itextpdf.text.exceptions.InvalidPdfException

          String str = readString(arrLength);
          int idx = str.lastIndexOf("startxref");
          if (idx >= 0) return pos + idx;
          pos = pos - arrLength + 9; // 9 = "startxref".length()
      }
        throw new InvalidPdfException(MessageLocalization.getComposedMessage("pdf.startxref.not.found"));
    }
View Full Code Here

Examples of com.itextpdf.text.exceptions.InvalidPdfException

                rebuilt = true;
                rebuildXref();
                lastXref = -1;
            }
            catch (Exception ne) {
                throw new InvalidPdfException(MessageLocalization.getComposedMessage("rebuild.failed.1.original.message.2", ne.getMessage(), e.getMessage()));
            }
        }
        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;
            try{
                rebuildXref();
                lastXref = -1;
                readDocObj();
            } catch (Exception ne){
                throw new InvalidPdfException(MessageLocalization.getComposedMessage("rebuild.failed.1.original.message.2", ne.getMessage(), e.getMessage()));
            }
        }
        strings.clear();
        readPages();
        //eliminateSharedStreams();
View Full Code Here

Examples of com.itextpdf.text.exceptions.InvalidPdfException

      try {
        rebuilt = true;
        rebuildXref();
        lastXref = -1;
      } catch (Exception ne) {
        throw new InvalidPdfException(
            MessageLocalization.getComposedMessage(
                "rebuild.failed.1.original.message.2",
                ne.getMessage(), e.getMessage()), ne);
      }
    }
View Full Code Here

Examples of com.lowagie.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.lowagie.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.lowagie.text.exceptions.InvalidPdfException

    public void checkFdfHeader() throws IOException {
        file.setStartOffset(0);
        String str = readString(1024);
        int idx = str.indexOf("%FDF-1.2");
        if (idx < 0)
            throw new InvalidPdfException(MessageLocalization.getComposedMessage("fdf.header.not.found"));
        file.setStartOffset(idx);
    }
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.