Interface DocumentPdfMetadata

  • All Implemented Interfaces:

    
    public interface DocumentPdfMetadata
    
                        

    This class allows you to modify a PDF documents metadata.

    Metadata is defined in two ways in the PDF spec (§ 14.3): - The Info PDF dictionary. This class is handling this. - A metadata stream containing XMP data. See DocumentXmpMetadata for that.

    Use getPdfMetadata to retrieve an instance of this class.

    • Constructor Detail

    • Method Detail

      • getTitle

        @Nullable() abstract String getTitle()

        Returns the title given to the document.

        Returns:

        Document title, or null of there's not title.

      • setTitle

         abstract void setTitle(@Nullable() String title)

        Sets the title for the document.

        Parameters:
        title - Title for the document, or null to remove it.
      • getAuthor

        @Nullable() abstract String getAuthor()

        Returns the author of the document.

        Returns:

        Author of the document, or null if non-existent.

      • setAuthor

         abstract void setAuthor(@Nullable() String author)

        Sets the author for the document.

        Parameters:
        author - Author for the document, or null to remove it.
      • getSubject

        @Nullable() abstract String getSubject()

        Returns the subject of the document.

        Returns:

        Subject of the document, or null if non-existent.

      • setSubject

         abstract void setSubject(@Nullable() String subject)

        Sets the subject for the document.

        Parameters:
        subject - Subject for the document, or null to remove it.
      • setKeywords

         abstract void setKeywords(@Nullable() List<String> keywords)

        Sets the keywords for the document.

        Parameters:
        keywords - List of keywords for the document, or null/empty list to remove them.
      • getCreator

        @Nullable() abstract String getCreator()

        Returns software used to create the document.

        Returns:

        Software used to create the document, or null if not set.

      • setCreator

         abstract void setCreator(@Nullable() String creator)

        Sets the creator for the document.

        Parameters:
        creator - Creator for the document, or null to remove it.
      • getProducer

        @Nullable() abstract String getProducer()

        Returns software library used to create the document.

        Returns:

        Software library used to create the document, or null if not set.

      • setProducer

         abstract void setProducer(@Nullable() String producer)

        Sets the producer for the document.

        Parameters:
        producer - Producer for the document, or null to remove it.
      • getCreationDate

        @Nullable() abstract Date getCreationDate()

        Returns the document creation date (if set).

        Returns:

        Creation date or null if not set.

      • setCreationDate

         abstract void setCreationDate(@Nullable() Date creationDate)

        Sets the creation date for the document.

        Parameters:
        creationDate - Creation date for the document, or null to remove it.
      • getModificationDate

        @Nullable() abstract Date getModificationDate()

        Returns the date of when the document was last modified (if any).

        Returns:

        Modification date or null if not set.

      • setModificationDate

         abstract void setModificationDate(@Nullable() Date modificationDate)

        Sets the modification date for the document.

        Parameters:
        modificationDate - Modification date for the document, or null to remove it.
      • get

        @Nullable() abstract PdfValue get(@NonNull() String key)

        Retrieves a single metadata value from PDF.

        Parameters:
        key - Metadata key, must not be null.
        Returns:

        a PdfValue instance representing a value or null.

      • set

         abstract void set(@NonNull() String key, @Nullable() PdfValue value)

        Sets a single value in the PDF.

        Parameters:
        key - Metadata key, must not be null.
        value - New value or null to remove the value.
      • hasUnsavedChanges

         abstract boolean hasUnsavedChanges()

        Returns true if there were any changes to the PDF metadata without save.

        Returns:

        true if PDF metadata was changed, false otherwise.