You can read all the details at: Convert Project File (MPP) to PDF Programmatically in Java
Last active
December 23, 2021 07:01
-
-
Save aspose-com-gists/23aa343d20cceae373dedb9319d43446 to your computer and use it in GitHub Desktop.
Convert Project File (MPP) to PDF Programmatically in Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load input MPP file | |
Project project = new Project("project.mpp"); | |
// Initilize SaveOptions class object | |
SaveOptions o = new PdfSaveOptions(); | |
// Set the row height to fit cell content | |
o.setFitContent(true); | |
// Specify different properties | |
o.setTimescale(Timescale.Months); | |
o.setPresentationFormat(PresentationFormat.TaskUsage); | |
// Set the LegendOnEachPage property to false to hide legends | |
o.setLegendOnEachPage(false); | |
// Save output PDF document | |
project.save("result.pdf", o); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load input Project file | |
Project project = new Project(dataDir + "project.mpp"); | |
// Initialize PdfEncryptionDetails class object | |
PdfEncryptionDetails encryptionDetails = new PdfEncryptionDetails("test", "password", PdfEncryptionAlgorithm.RC4_128); | |
// Set permissions for output PDF file | |
encryptionDetails.setPermissions(PdfPermissions.None); | |
// Initialize PdfSaveOptions class object | |
PdfSaveOptions saveOptions = new PdfSaveOptions(); | |
saveOptions.setTimescale(Timescale.Months); | |
saveOptions.setPresentationFormat(PresentationFormat.TaskUsage); | |
saveOptions.setEncryptionDetails(encryptionDetails); | |
// Save output PDF file | |
project.save(dataDir + "Password_output.pdf", saveOptions); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Read the input Project file | |
Project project = new Project("Sample.mpp"); | |
// Save the Project as PDF | |
project.save("Project.pdf", SaveFileFormat.PDF); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment