Class PdfDocumentInfo

java.lang.Object
com.itextpdf.kernel.pdf.PdfDocumentInfo

public class PdfDocumentInfo extends Object
The class is a wrapper around Info dictionary from PdfDocument root which provides utility methods to work with the Info dictionary.

For more information about each of the PDF document info key, see ISO 32000-2 Table 349.

  • Method Details

    • setTitle

      public PdfDocumentInfo setTitle (String title)
      Sets title of the PdfDocument.
      Parameters:
      title - the title to set
      Returns:
      the current PdfDocumentInfo instance
    • setAuthor

      public PdfDocumentInfo setAuthor (String author)
      Sets the author of the PdfDocument.
      Parameters:
      author - the author to set
      Returns:
      the current PdfDocumentInfo instance
    • setSubject

      public PdfDocumentInfo setSubject (String subject)
      Sets the subject of the PdfDocument.
      Parameters:
      subject - the subject to set
      Returns:
      the current PdfDocumentInfo instance
    • setKeywords

      public PdfDocumentInfo setKeywords (String keywords)
      Sets the keywords of the PdfDocument.
      Parameters:
      keywords - the keywords to set
      Returns:
      the current PdfDocumentInfo instance
    • setCreator

      public PdfDocumentInfo setCreator (String creator)
      Sets the creator of the PdfDocument.
      Parameters:
      creator - the creator to set
      Returns:
      the current PdfDocumentInfo instance
    • setProducer

      public PdfDocumentInfo setProducer (String producer)
      Sets a producer line for the PdfDocument described by this instance.
      Parameters:
      producer - is a new producer line to set
      Returns:
      this instance
    • setTrapped

      public PdfDocumentInfo setTrapped (PdfName trapped)
      Sets the trapped of the PdfDocument.

      The value indicates whether the document has been modified to include trapping information or not.

      Parameters:
      trapped - trapped to set
      Returns:
      the current PdfDocumentInfo instance
    • getTitle

      public String getTitle()
      Gets the title of the PdfDocument.
      Returns:
      the title
    • getAuthor

      public String getAuthor()
      Gets the author of the PdfDocument.
      Returns:
      the author
    • getSubject

      public String getSubject()
      Gets the subject of the PdfDocument.
      Returns:
      the subject
    • getKeywords

      public String getKeywords()
      Gets the keywords of the PdfDocument.
      Returns:
      the keywords
    • getCreator

      public String getCreator()
      Gets the creator of the PdfDocument.
      Returns:
      the creator
    • getProducer

      public String getProducer()
      Gets the producer of the PdfDocument.
      Returns:
      the producer
    • getTrapped

      public PdfName getTrapped()
      Gets the trapped of the PdfDocument.

      The value indicates whether the document has been modified to include trapping information or not.

      Returns:
      the trapped
    • addCreationDate

      public PdfDocumentInfo addCreationDate()
      Adds the creation date of the PdfDocument.
      Returns:
      the current PdfDocumentInfo instance
    • removeCreationDate

      public PdfDocumentInfo removeCreationDate()
      Remove creation date from the document info dictionary.
      Returns:
      this instance.
    • addModDate

      public PdfDocumentInfo addModDate()
      Adds modification date of the PdfDocument.
      Returns:
      the current PdfDocumentInfo instance
    • setMoreInfo

      public void setMoreInfo (Map<String,String> moreInfo)
      Sets custom keys and values into Info dictionary of the PdfDocument.
      Parameters:
      moreInfo - the map of keys and values to be set
    • setMoreInfo

      public void setMoreInfo (String key, String value)
      Sets custom key and value into Info dictionary of the PdfDocument.
      Parameters:
      key - the key
      value - the value
    • getMoreInfo

      public String getMoreInfo (String key)
      Gets the value of additional key of Info dictionary.
      Parameters:
      key - the key to get value for
      Returns:
      the value or null if there is no value for such a key