com.groupdocs.metadata.core

Interfaces

Classes

Exceptions

com.groupdocs.metadata.core

Class PdfPackage

  • All Implemented Interfaces:
    Iterable<MetadataProperty>


    public class PdfPackage
    extends DocumentPackage

    Represents native metadata in a PDF document.

    Learn more

    This code snippet demonstrates how to update built-in metadata properties in a PDF document.

    try (Metadata metadata = new Metadata(Constants.InputPdf)) {
         PdfRootPackage root = metadata.getRootPackageGeneric();
         root.getDocumentProperties().setAuthor("test author");
         root.getDocumentProperties().setCreatedDate(new Date());
         root.getDocumentProperties().setTitle("test title");
         root.getDocumentProperties().setKeywords("metadata, built-in, update");
         // ...
         metadata.save(Constants.OutputPdf);
     }
     
    • Method Detail

      • getAuthor

        public final String getAuthor()

        Gets the document author.

        Returns:
        The document author.
      • setAuthor

        public final void setAuthor(String value)

        Sets the document author.

        Parameters:
        value - The document author.
      • getCreatedDate

        public final Date getCreatedDate()

        Gets the date of document creation.

        Returns:
        The date of document creation.
      • setCreatedDate

        public final void setCreatedDate(Date value)

        Sets the date of document creation.

        Parameters:
        value - The date of document creation.
      • getCreator

        public final String getCreator()

        Gets the creator of the document.

        Returns:
        The creator of the document.
      • getKeywords

        public final String getKeywords()

        Gets the keywords.

        Returns:
        The keywords.
      • setKeywords

        public final void setKeywords(String value)

        Sets the keywords.

        Parameters:
        value - The keywords.
      • getModifiedDate

        public final Date getModifiedDate()

        Gets the date of the last modification.

        Returns:
        The date of the last modification.
      • setModifiedDate

        public final void setModifiedDate(Date value)

        Sets the date of the last modification.

        Parameters:
        value - The date of the last modification.
      • getProducer

        public final String getProducer()

        Gets the document producer.

        Returns:
        The document producer.
      • getSubject

        public final String getSubject()

        Gets the subject of the document.

        Returns:
        The subject of the document.
      • setSubject

        public final void setSubject(String value)

        Sets the subject of the document.

        Parameters:
        value - The subject of the document.
      • getTitle

        public final String getTitle()

        Gets the title of the document.

        Returns:
        The title of the document.
      • setTitle

        public final void setTitle(String value)

        Sets the title of the document.

        Parameters:
        value - The title of the document.
      • getTrappedFlag

        public final Boolean getTrappedFlag()

        Gets the trapped flag.

        Returns:
        true if the trapped flag is set; otherwise, false.
      • setTrappedFlag

        public final void setTrappedFlag(Boolean value)

        Sets the trapped flag.

        Parameters:
        value - true if the trapped flag is set; otherwise, false.
      • set

        public final void set(String propertyName,
               String value)

        Adds or replaces the metadata property with the specified name.

        Parameters:
        propertyName - The property name.
        value - The property value.