[]
        
(Showing Draft Content)

DocumentProperties

Class DocumentProperties

java.lang.Object
com.grapecity.documents.excel.DocumentProperties

public class DocumentProperties extends Object
Represents the document properties of a PDF document.

Use this class to define PDF metadata such as the title, author, subject, keywords, creator, producer, creation date, modification date, and the PDF version to use when generating the document. Assign an instance to PdfSaveOptions.setDocumentProperties(DocumentProperties) to apply these properties during PDF export.


 Workbook workbook = new Workbook();
 IWorksheet worksheet = workbook.getWorksheets().get(0);
 worksheet.getRange("A1").setValue("Quarterly Sales Summary");
 DocumentProperties documentProperties = new DocumentProperties();
 documentProperties.setTitle("Quarterly Sales Summary");
 documentProperties.setAuthor("Author");
 documentProperties.setPdfVersion(1.5f);
 PdfSaveOptions options = new PdfSaveOptions();
 options.setDocumentProperties(documentProperties);
 String fileName = "DocumentProperties.pdf";
 workbook.save(fileName, options);
 
  • Constructor Details

    • DocumentProperties

      public DocumentProperties()
  • Method Details

    • getPdfVersion

      public float getPdfVersion()
      Gets the PDF version of the generated document.

      This value specifies the PDF version that is used when generating the document.

      
       DocumentProperties properties = new DocumentProperties();
       properties.setPdfVersion(1.4f);
       float pdfVersion = properties.getPdfVersion();
       
      Returns:
      The PDF version of the generated document.
    • setPdfVersion

      public void setPdfVersion(float value)
      Sets the PDF version of the generated document.

      This value specifies the PDF version that is used when generating the document.

      
       DocumentProperties properties = new DocumentProperties();
       properties.setPdfVersion(1.4f);
       
      Parameters:
      value - The PDF version of the generated document.
    • getTitle

      public String getTitle()
      Gets the title of the document.

      This property specifies the title stored in the document properties.

      
       DocumentProperties properties = new DocumentProperties();
       properties.setTitle("Quarterly Sales Summary");
       String title = properties.getTitle();
       
      Returns:
      The title of the document.
    • setTitle

      public void setTitle(String value)
      Sets the title of the document.

      This property specifies the title stored in the document properties.

      
       DocumentProperties properties = new DocumentProperties();
       properties.setTitle("Quarterly Sales Summary");
       
      Parameters:
      value - The title of the document.
    • getAuthor

      public String getAuthor()
      Gets the name of the person that created the document.
      
       DocumentProperties properties = new DocumentProperties();
       properties.setAuthor("Author");
       String author = properties.getAuthor();
       
      Returns:
      The name of the person that created the document. Returns null if no author has been set.
    • setAuthor

      public void setAuthor(String value)
      Sets the name of the person that created the document.
      
       DocumentProperties properties = new DocumentProperties();
       properties.setAuthor("Author");
       
      Parameters:
      value - The name of the person that created the document. Sets null if no author has been set.
    • getSubject

      public String getSubject()
      Gets the subject of the document.

      Use this property to retrieve the subject metadata associated with the document.

      
       DocumentProperties properties = new DocumentProperties();
       properties.setSubject("Quarterly Sales Summary");
       String subject = properties.getSubject();
       
      Returns:
      The subject of the document.
    • setSubject

      public void setSubject(String value)
      Sets the subject of the document.

      Use this property to set the subject metadata associated with the document.

      
       DocumentProperties properties = new DocumentProperties();
       properties.setSubject("Quarterly Sales Summary");
       
      Parameters:
      value - The subject of the document.
    • getKeywords

      public String getKeywords()
      Gets the keywords associated with the document.

      The returned string contains the document keywords as a comma-separated list.

      
       DocumentProperties properties = new DocumentProperties();
       properties.setKeywords("report, sales, quarterly");
       String keywords = properties.getKeywords();
       
      Returns:
      The comma-separated keywords associated with the document, or null if no keywords have been set.
    • setKeywords

      public void setKeywords(String value)
      Sets the keywords associated with the document.

      The returned string contains the document keywords as a comma-separated list.

      
       DocumentProperties properties = new DocumentProperties();
       properties.setKeywords("report, sales, quarterly");
       
      Parameters:
      value - The comma-separated keywords associated with the document, or null if no keywords have been set.
    • getCreator

      public String getCreator()
      Gets the name of the application that created the original document.

      This value represents the original document or application creator. It is distinct from getProducer(), which identifies the application or library that produced the PDF document.

      
       DocumentProperties properties = new DocumentProperties();
       properties.setCreator("Report Designer");
       String creator = properties.getCreator();
       
      Returns:
      The name of the application that created the original document, or null if it has not been set.
    • setCreator

      public void setCreator(String value)
      Sets the name of the application that created the original document.

      This value represents the original document or application creator. It is distinct from getProducer(), which identifies the application or library that produced the PDF document.

      
       DocumentProperties properties = new DocumentProperties();
       properties.setCreator("Report Designer");
       
      Parameters:
      value - The name of the application that created the original document, or null if it has not been set.
    • getProducer

      public String getProducer()
      Gets the name of the application or library that produced the PDF document.

      This value represents the PDF producer or exporter and is distinct from getCreator(), which identifies the original document or application creator.

      
       DocumentProperties properties = new DocumentProperties();
       properties.setProducer("PDF Exporter");
       String producer = properties.getProducer();
       
      Returns:
      The name of the application or library that produced the PDF document. Returns null if no producer has been set.
    • setProducer

      public void setProducer(String value)
      Sets the name of the application or library that produced the PDF document.

      This value represents the PDF producer or exporter and is distinct from getCreator(), which identifies the original document or application creator.

      
       DocumentProperties properties = new DocumentProperties();
       properties.setProducer("PDF Exporter");
       
      Parameters:
      value - The name of the application or library that produced the PDF document. Sets null if no producer has been set.
    • getCreationDate

      public Calendar getCreationDate()
      Gets the creation date and time of the document.

      Use this method to retrieve the value previously assigned by setCreationDate(Calendar) for PDF document properties.

      
       DocumentProperties properties = new DocumentProperties();
       properties.setCreationDate(new GregorianCalendar(2019, 5, 24));
       Calendar creationDate = properties.getCreationDate();
       
      Returns:
      The creation date and time of the document, or null if no creation date has been set.
    • setCreationDate

      public void setCreationDate(Calendar value)
      Sets the date and time the document was created.

      Use this method to assign the creation timestamp stored in the document properties.

      
       DocumentProperties properties = new DocumentProperties();
       Calendar creationDate = new GregorianCalendar(2024, 2, 15, 10, 30, 0);
       properties.setCreationDate(creationDate);
       
      Parameters:
      value - The creation date and time to set. This value can be null.
    • getModifyDate

      public Calendar getModifyDate()
      Gets the date and time when the document was most recently modified.

      Use this method to retrieve the modification timestamp stored in this DocumentProperties instance.

      
       DocumentProperties properties = new DocumentProperties();
       properties.setModifyDate(new GregorianCalendar(2020, 5, 24));
       Calendar modifyDate = properties.getModifyDate();
       
      Returns:
      The date and time when the document was most recently modified, or null if no modify date has been set.
    • setModifyDate

      public void setModifyDate(Calendar value)
      Sets the date and time the document was most recently modified.

      Use this property to store the modification timestamp in the PDF document properties. Passing null clears the stored modification date.

      
       DocumentProperties properties = new DocumentProperties();
       properties.setCreationDate(new GregorianCalendar(2019, 5, 24));
       properties.setModifyDate(new GregorianCalendar(2020, 5, 24));
       
      Parameters:
      value - The modification date and time to set. null clears the stored modification date.
    • toString

      public String toString()
      Returns a string that describes the current document properties.
      Overrides:
      toString in class Object
      Returns:
      A string that contains the PDF version and metadata values stored in this instance.