Class PdfVersionImp

java.lang.Object
org.openpdf.text.pdf.internal.PdfVersionImp
All Implemented Interfaces:
PdfVersion

public class PdfVersionImp extends Object implements PdfVersion
Stores the PDF version information, knows how to write a PDF Header, and how to add the version to the catalog (if necessary). For OpenPDF 3.0 this was updated to support PDF 2.0, and specifying PDF version using String "2.0" instead of char.
  • Field Details

    • headerWasWritten

      protected boolean headerWasWritten
      Indicates if the header was already written.
    • appendmode

      protected boolean appendmode
      Indicates if we are working in append mode.
    • header_version

      protected String header_version
      The version that was or will be written to the header.
    • catalog_version

      protected PdfName catalog_version
      The version that will be written to the catalog.
    • extensions

      protected PdfDictionary extensions
      The extensions dictionary.
      Since:
      2.1.6
  • Constructor Details

    • PdfVersionImp

      public PdfVersionImp()
  • Method Details

    • writeHeader

      public void writeHeader(OutputStreamCounter os) throws IOException
      Writes the header to the OutputStreamCounter.
      Parameters:
      os - the OutputStreamCounter
      Throws:
      IOException - thrown when an I/O operation goes wrong
    • getVersionAsName

      public PdfName getVersionAsName(String version)
      Returns the PDF version as a name.
      Parameters:
      version - the version string.
      Returns:
      a PdfName that contains the version
    • getVersionAsByteArray

      public byte[] getVersionAsByteArray(String version)
      Returns the version as a byte[].
      Parameters:
      version - the version string
      Returns:
      a byte array containing the version according to the ISO-8859-1 codepage.
    • addToCatalog

      public void addToCatalog(PdfDictionary catalog)
      Adds the version to the Catalog dictionary.
      Parameters:
      catalog - The PdfDictionary to add the version to