Skip to main content

DocumentExportOptions Class

Contains document-level PDF export options.

Declaration

public class DocumentExportOptions extends JavaObject

Remarks

Use the DocumentExportOptions class to specify standard PDF document properties, such as the author, title, subject, keywords, application, and producer.

Call the getDocumentOptions() method to access PDF document properties.

The following code snippet exports a PowerPoint presentation to PDF and sets the PDF document metadata, including the author, application, keywords, producer, subject, and title:

package presentation;

import com.devexpress.docs.presentation.*;
import com.devexpress.docs.presentation.exports.PdfExportOptions;

import java.io.FileOutputStream;
import java.nio.file.*;

public class Main {
    public static void main(String[] args) throws Exception {
        try(Presentation presentation =
                    new Presentation(Files.readAllBytes(Path.of("Sample.pptx")))) {

            Path outputDir = Path.of("output");
            Files.createDirectories(outputDir);

            try (FileOutputStream exportStream = new FileOutputStream(
                    outputDir.resolve("presentation.pdf").toFile())) {

                PdfExportOptions exportOptions = new PdfExportOptions();
                exportOptions.getDocumentOptions().setAuthor("Simon Peacock");
                exportOptions.getDocumentOptions().setApplication("DevExpress Presentation API");
                exportOptions.getDocumentOptions().setKeywords("Presentation, DevExpress, Exported, PDF");
                exportOptions.getDocumentOptions().setProducer("Developer Express Inc., 26.1.4");
                exportOptions.getDocumentOptions().setSubject("Test Presentation");
                exportOptions.getDocumentOptions().setTitle("Presentation Title");

                presentation.exportToPdf(exportStream, exportOptions);
            }
        }
    }
}

Inherited Members

com.devexpress.system.JavaObject.clone()
com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.initFields()
com.devexpress.system.JavaObject.memberwiseClone()
com.devexpress.system.JavaObject.toString()
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)

Inheritance

Object
com.devexpress.system.JavaObject
DocumentExportOptions

DocumentExportOptions()

Initializes a new instance of the DocumentExportOptions class.

Declaration

public DocumentExportOptions()

Methods

getApplication() Method

Returns the name of the application that created the original document.

Declaration

public String getApplication()

Returns

Type Description
String

The application name.

getAuthor() Method

Returns the document author’s name.

Declaration

public String getAuthor()

Returns

Type Description
String

The author.

getKeywords() Method

Returns document keywords.

Declaration

public String getKeywords()

Returns

Type Description
String

Document keywords.

getProducer() Method

Returns the name of the application or library that produced the exported PDF document.

Declaration

public String getProducer()

Returns

Type Description
String

The document producer.

getSubject() Method

Returns the document subject.

Declaration

public String getSubject()

Returns

Type Description
String

The document subject.

getTitle() Method

Returns the document title.

Declaration

public String getTitle()

Returns

Type Description
String

The document title.

setApplication(String value) Method

Sets the name of the application that created the original document.

Declaration

public void setApplication(String value)

Parameters

Name Type Description
value String

The application name.

setAuthor(String value) Method

Sets the document author’s name.

Declaration

public void setAuthor(String value)

Parameters

Name Type Description
value String

The author.

setKeywords(String value) Method

Sets document keywords.

Declaration

public void setKeywords(String value)

Parameters

Name Type Description
value String

Document keywords.

setProducer(String value) Method

Sets the name of the application or library that produced the exported PDF document.

Declaration

public void setProducer(String value)

Parameters

Name Type Description
value String

The document producer.

setSubject(String value) Method

Sets the document subject.

Declaration

public void setSubject(String value)

Parameters

Name Type Description
value String

The document subject.

setTitle(String value) Method

Sets the document title.

Declaration

public void setTitle(String value)

Parameters

Name Type Description
value String

The document title.