Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aspose-com-kb/7fcf31868ba6c5f81e8f87d18525f71a to your computer and use it in GitHub Desktop.
Save aspose-com-kb/7fcf31868ba6c5f81e8f87d18525f71a to your computer and use it in GitHub Desktop.
This code can be used to convert Microsoft Project File to XPS. For further details, refer to the article https://kb.aspose.com/tasks/java/how-to-convert-microsoft-project-file-to-xps-in-java/
import com.aspose.barcode.License;
import com.aspose.tasks.Project;
import com.aspose.tasks.SaveFileFormat;
public class ConvertMicrosoftProjectFileToXPSInJava {
public static void main(String[] args) throws Exception{ // main function for ConvertMicrosoftProjectFileToXPSInJava class
// Set Aspose.Tasks license to remove trial version watermark in the output XPS file converted from MPP
License tasksLicense = new License();
tasksLicense.setLicense("Aspose.Tasks.lic");
// Load the input MPP file to be converted to XPS
Project sourceMPPFile = new Project("InputMPPFile.mpp");
// Save the output XPS file using SaveFileFormat enumerator
sourceMPPFile.save("OutputXPSFile.xps", SaveFileFormat.XPS);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment