PdfPackage

Inheritance: java.lang.Object, com.groupdocs.metadata.core.MetadataPackage, com.groupdocs.metadata.core.CustomPackage, com.groupdocs.metadata.core.DocumentPackage

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); }

Methods

Method Description
getAuthor() Gets the document author.
setAuthor(String value) Sets the document author.
getCreatedDate() Gets the date of document creation.
setCreatedDate(Date value) Sets the date of document creation.
getCreator() Gets the creator of the document.
setCreator(String value) Gets the creator of the document.
getKeywords() Gets the keywords.
setKeywords(String value) Sets the keywords.
getModifiedDate() Gets the date of the last modification.
setModifiedDate(Date value) Sets the date of the last modification.
getProducer() Gets the document producer.
setProducer(String value) Gets the document producer.
getSubject() Gets the subject of the document.
setSubject(String value) Sets the subject of the document.
getTitle() Gets the title of the document.
setTitle(String value) Sets the title of the document.
getTrappedFlag() Gets the trapped flag.
setTrappedFlag(Boolean value) Sets the trapped flag.
set(String propertyName, String value) Adds or replaces the metadata property with the specified name.

getAuthor()

public final String getAuthor()

Gets the document author.

Returns: java.lang.String - The document author.

setAuthor(String value)

public final void setAuthor(String value)

Sets the document author.

Parameters:

Parameter Type Description
value java.lang.String The document author.

getCreatedDate()

public final Date getCreatedDate()

Gets the date of document creation.

Returns: java.util.Date - The date of document creation.

setCreatedDate(Date value)

public final void setCreatedDate(Date value)

Sets the date of document creation.

Parameters:

Parameter Type Description
value java.util.Date The date of document creation.

getCreator()

public final String getCreator()

Gets the creator of the document.

Returns: java.lang.String - The creator of the document.

setCreator(String value)

public final void setCreator(String value)

Gets the creator of the document.

Value: The creator of the document.

Parameters:

Parameter Type Description
value java.lang.String

getKeywords()

public final String getKeywords()

Gets the keywords.

Returns: java.lang.String - The keywords.

setKeywords(String value)

public final void setKeywords(String value)

Sets the keywords.

Parameters:

Parameter Type Description
value java.lang.String The keywords.

getModifiedDate()

public final Date getModifiedDate()

Gets the date of the last modification.

Returns: java.util.Date - The date of the last modification.

setModifiedDate(Date value)

public final void setModifiedDate(Date value)

Sets the date of the last modification.

Parameters:

Parameter Type Description
value java.util.Date The date of the last modification.

getProducer()

public final String getProducer()

Gets the document producer.

Returns: java.lang.String - The document producer.

setProducer(String value)

public final void setProducer(String value)

Gets the document producer.

Value: The document producer.

Parameters:

Parameter Type Description
value java.lang.String

getSubject()

public final String getSubject()

Gets the subject of the document.

Returns: java.lang.String - The subject of the document.

setSubject(String value)

public final void setSubject(String value)

Sets the subject of the document.

Parameters:

Parameter Type Description
value java.lang.String The subject of the document.

getTitle()

public final String getTitle()

Gets the title of the document.

Returns: java.lang.String - The title of the document.

setTitle(String value)

public final void setTitle(String value)

Sets the title of the document.

Parameters:

Parameter Type Description
value java.lang.String The title of the document.

getTrappedFlag()

public final Boolean getTrappedFlag()

Gets the trapped flag.

Returns: java.lang.Boolean - true if the trapped flag is set; otherwise, false .

setTrappedFlag(Boolean value)

public final void setTrappedFlag(Boolean value)

Sets the trapped flag.

Parameters:

Parameter Type Description
value java.lang.Boolean true if the trapped flag is set; otherwise, false .

set(String propertyName, String value)

public final void set(String propertyName, String value)

Adds or replaces the metadata property with the specified name.

Parameters:

Parameter Type Description
propertyName java.lang.String The property name.
value java.lang.String The property value.