Class PDFParser

java.lang.Object
org.sejda.sambox.input.PDFParser

public class PDFParser extends Object
Provides public entry point to parse a SeekableSource and obtain a PDDocument or IncrementablePDDocument.
Author:
Andrea Vacondio
  • Constructor Details

    • PDFParser

      public PDFParser()
  • Method Details

    • parse

      public static PDDocument parse(org.sejda.io.SeekableSource source) throws IOException
      Parses the given SeekableSource returning the corresponding PDDocument.
      Parameters:
      source -
      Returns:
      the parsed document
      Throws:
      IOException
    • parseToIncrement

      public static IncrementablePDDocument parseToIncrement(org.sejda.io.SeekableSource source) throws IOException
      Parses the given SeekableSource returning the corresponding IncrementablePDDocument.
      Parameters:
      source -
      Returns:
      the incrementable document
      Throws:
      IOException
    • parse

      public static PDDocument parse(org.sejda.io.SeekableSource source, String password) throws IOException
      Parses the given SeekableSource using the given password, returning the corresponding decrypted PDDocument.
      Parameters:
      source - SeekableSource to parse
      password - to be used for decryption. Optional.
      Returns:
      the parsed document
      Throws:
      IOException
    • parseToIncrement

      public static IncrementablePDDocument parseToIncrement(org.sejda.io.SeekableSource source, String password) throws IOException
      Parses the given SeekableSource using the given password, , returning the corresponding decrypted IncrementablePDDocument to be used for an incremental update.
      Parameters:
      source - SeekableSource to parse
      password - to be used for decryption. Optional.
      Returns:
      the incrementable document
      Throws:
      IOException
    • parse

      public static PDDocument parse(org.sejda.io.SeekableSource source, DecryptionMaterial decryptionMaterial) throws IOException
      Parses the given SeekableSource using the given DecryptionMaterial, returning the corresponding decrypted PDDocument.
      Parameters:
      source - SeekableSource to parse
      decryptionMaterial - to be used for decryption. Optional.
      Returns:
      the parsed document
      Throws:
      IOException
    • parseToIncrement

      public static IncrementablePDDocument parseToIncrement(org.sejda.io.SeekableSource source, DecryptionMaterial decryptionMaterial) throws IOException
      Parses the given SeekableSource using the given DecryptionMaterial, returning the corresponding decrypted IncrementablePDDocument to be used for an incremental update.
      Parameters:
      source - SeekableSource to parse
      decryptionMaterial - to be used for decryption. Optional.
      Returns:
      the incrementable document
      Throws:
      IOException