You can read all the details at: Convert MPP File to PDF Programmatically using C# .NET
Last active
December 23, 2021 06:55
-
-
Save aspose-com-gists/920d26296d6511da9bf9ef8b503341f7 to your computer and use it in GitHub Desktop.
Convert MPP File to PDF Programmatically using C# .NET | Microsoft Project File Conversion
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 (Microsoft Project) file | |
Project project = new Project("New Project.mpp"); | |
// Initialize PdfSaveOptions class object | |
PdfSaveOptions options = new PdfSaveOptions(); | |
// Set SaveToSeparateFiles to true | |
options.SaveToSeparateFiles = true; | |
// Specify the page numbers | |
options.Pages = new List<int>(); | |
options.Pages.Add(1); | |
options.Pages.Add(4); | |
// Save output PDF file | |
project.Save("SaveToMultiplePDFFiles_out.pdf", (SaveOptions)options); |
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) Project file | |
Project project = new Project("project.mpp"); | |
// Initialize PdfEncryptionDetails class object | |
PdfEncryptionDetails encryptionDetails = new PdfEncryptionDetails("test", "password", PdfEncryptionAlgorithm.RC4_128); | |
// Set permissions for output PDF file | |
encryptionDetails.Permissions = PdfPermissions.None; | |
// Initialize PdfSaveOptions class object | |
PdfSaveOptions saveOptions = new PdfSaveOptions(); | |
saveOptions.Timescale = Timescale.Months; | |
saveOptions.PresentationFormat = PresentationFormat.TaskUsage; | |
saveOptions.EncryptionDetails = encryptionDetails; | |
// Save output PDF file | |
project.Save("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
// Load input Project file (MPP) | |
Project project = new Project(dataDir + "project.mpp"); | |
// Save output PDF file | |
project.Save("SaveProjectAsPDF_out.pdf", SaveFileFormat.PDF); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment