Class PdfA3Converter

java.lang.Object
org.jpedal.tools.pdfa.PdfA3Converter

public final class PdfA3Converter extends Object
Converts PDF files into valid PDF/A-3 files.
  • Constructor Details

  • Method Details

    • setMemoryCacheThreshold

      public void setMemoryCacheThreshold(int memoryCacheThreshold)
      Set the threshold at which temporary files created by the PDF/A-3 Converter which exceed this size will be written to the disk rather than stored in memory.

      Default: 58MB

      Parameters:
      memoryCacheThreshold - the threshold
      See Also:
    • getMemoryCacheThreshold

      public int getMemoryCacheThreshold()
      Returns the current threshold for which temporary files are written to disk rather than being stored in memory.
      Returns:
      the current threshold for which temporary files are written to disk rather than being stored in memory
      See Also:
    • convert

      public PdfA3Converter.ConversionResult convert(File input, File output) throws IOException
      Convert the given PDF file into a PDF/A-3 file, writing the result to output. The input file is assumed not to be password protected.
      Parameters:
      input - the PDF file to convert
      output - the file to write the converted PDF/A-3 file to
      Returns:
      the result of the conversion
      Throws:
      IOException - if the input file is invalid or an I/O error occurs during conversion
      See Also:
    • convert

      public PdfA3Converter.ConversionResult convert(File input, byte[] password, File output) throws IOException
      Convert the given PDF file into a PDF/A-3 file, writing the result to output.

      If the file cannot be made compliant, no output file is written and the returned result's list of issues will be non-empty.

      Parameters:
      input - the PDF file to convert
      password - the password to decrypt the input file, or null if it is not encrypted
      output - the file to write the converted PDF/A-3 file to
      Returns:
      the result of the conversion
      Throws:
      IOException - if the input file does not exist, is not a file, is not a PDF, or an I/O error occurs during conversion
    • main

      public static void main(String[] args)
      Command-line entry point for the PDF/A-3 converter.

      Accepts --level/-l, --output/-o and one or more --input/-i arguments (each optionally followed by --password/-p and a password value), as well as positional input paths. Each input may be a PDF file or a directory of PDF files; every resolved file is converted and written into the given output directory. Prints usage information and exits if the arguments are missing or invalid.

      Parameters:
      args - the command-line arguments