org.apache.fop.pdf

## Class PDFInfo

- java.lang.Object
- - org.apache.fop.pdf.PDFObject
  - - org.apache.fop.pdf.PDFInfo

- All Implemented Interfaces:
    PDFWritable

      public class PDFInfo
      extends PDFObject

  class representing an /Info object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `PDFInfo.StandardKey` The standard keys in the Document Information Dictionary

  - ### Field Summary

    - ### Fields inherited from class org.apache.fop.pdf.PDFObject

      `log`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PDFInfo()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static String` | `formatDateTime(Date time)` Formats a date/time according to the PDF specification.
    `protected static String` | `formatDateTime(Date time, TimeZone tz)` Formats a date/time according to the PDF specification (D:YYYYMMDDHHmmSSOHH'mm').
    `String` | `getAuthor()`
    `Date` | `getCreationDate()`
    `String` | `getCreator()`
    `String` | `getKeywords()`
    `Date` | `getModDate()`
    `String` | `getProducer()`
    `String` | `getSubject()`
    `String` | `getTitle()`
    `void` | `put(String key, String value)` Adds a custom property to this Info dictionary.
    `void` | `setAuthor(String a)` set the author string
    `void` | `setCreationDate(Date date)`
    `void` | `setCreator(String creator)` set the creator string
    `void` | `setKeywords(String k)` set the keywords string
    `void` | `setModDate(Date date)` Sets the date of the last modification.
    `void` | `setProducer(String producer)` set the producer string
    `void` | `setSubject(String s)` set the subject string
    `void` | `setTitle(String t)` set the title string
    `byte[]` | `toPDF()` Encodes the object as a byte array for output to a PDF file.

    - ### Methods inherited from class org.apache.fop.pdf.PDFObject

      `contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getChildren, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, output, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDFString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PDFInfo

          public PDFInfo()

  - ### Method Detail

    - #### getProducer

          public String getProducer()

      Returns:
        the producer of the document or null if not set

    - #### setProducer

          public void setProducer(String producer)

      set the producer string
      Parameters:
        `producer` - the producer string

    - #### getCreator

          public String getCreator()

      Returns:
        the creator of the document or null if not set

    - #### setCreator

          public void setCreator(String creator)

      set the creator string
      Parameters:
        `creator` - the document creator

    - #### getTitle

          public String getTitle()

      Returns:
        the title string

    - #### setTitle

          public void setTitle(String t)

      set the title string
      Parameters:
        `t` - the document title

    - #### getAuthor

          public String getAuthor()

      Returns:
        the author of the document or null if not set

    - #### setAuthor

          public void setAuthor(String a)

      set the author string
      Parameters:
        `a` - the document author

    - #### getSubject

          public String getSubject()

      Returns:
        the subject of the document or null if not set

    - #### setSubject

          public void setSubject(String s)

      set the subject string
      Parameters:
        `s` - the document subject

    - #### getKeywords

          public String getKeywords()

      Returns:
        the keywords for the document or null if not set

    - #### setKeywords

          public void setKeywords(String k)

      set the keywords string
      Parameters:
        `k` - the keywords for this document

    - #### getCreationDate

          public Date getCreationDate()

      Returns:
        last set creation date

    - #### setCreationDate

          public void setCreationDate(Date date)

      Parameters:
        `date` - Date to store in the PDF as creation date. Use null to force current system date.

    - #### getModDate

          public Date getModDate()

      Returns:
        last modification date

    - #### setModDate

          public void setModDate(Date date)

      Sets the date of the last modification.
      Parameters:
        `date` - the last modification date or null if there are no modifications

    - #### toPDF

          public byte[] toPDF()

      Encodes the object as a byte array for output to a PDF file.
      Overrides:
        `toPDF` in class `PDFObject`
      Returns:
        PDF string

    - #### formatDateTime

          protected static String formatDateTime(Date time,
                                                 TimeZone tz)

      Formats a date/time according to the PDF specification (D:YYYYMMDDHHmmSSOHH'mm').
      Parameters:
        `time` - date/time value to format
        `tz` - the time zone
      Returns:
        the requested String representation

    - #### formatDateTime

          protected static String formatDateTime(Date time)

      Formats a date/time according to the PDF specification. (D:YYYYMMDDHHmmSSOHH'mm').
      Parameters:
        `time` - date/time value to format
      Returns:
        the requested String representation

    - #### put

          public void put(String key,
                          String value)

      Adds a custom property to this Info dictionary.

Copyright © 2023 Apache Software Foundation. All rights reserved.