
Convert MS Project (MPP) to PDF with Node.js.
Microsoft Project (MPP) files are widely used in project management for planning and tracking tasks. However, sharing these files can be a challenge due to format restrictions. Converting MPP to PDF ensures platform independence and easy sharing, while preserving the layout. In this article, we walk you through how to convert MPP to PDF using the Node.js SDK.
Node.js SDK for MPP to PDF Conversion
Aspose.Tasks Cloud SDK for Node.js is a robust API that enables developers to manipulate and convert Microsoft Project files in the cloud. One of its most powerful features is MPP to PDF conversion, allowing you to create print-ready and shareable project files with ease.
Getting Started:
- Install the SDK via npm:
npm install aspose-tasks-cloud
- Create a free account and get your personalized client credentials from the Cloud dashboard. For further information, you may consider following the instructions specified in this article.
Convert MPP to PDF with Node.js
Here’s a sample Node.js code snippet to convert an MPP file to PDF:
- Create an object of TasksApi class while passing client credentials as input arguments.
const tasksApi = new TasksApi({ clientId, clientSecret });
- Create an instance of
GetTaskDocumentWithFormatRequest
where we define the name of input MPP file and required output format.
const request = new GetTaskDocumentWithFormatRequest({ ... });
- Now call the
getTaskDocumentWithFormat(...)
method to perform MPP to PDF file online.
tasksApi.getTaskDocumentWithFormat(request)
- The sample MPP file used in the above example can be downloaded from Home move plan.mpp.
Export MPP to PDF using cURL
If you prefer command line approach for converting an MPP to PDF using cURL commands, Aspose.Tasks Cloud supports these capabilities. Now let’s further explore this feature to simplify the requirement of converting MPP to PDF without any programming knowledge.
Step 1: Generate Access Token
Firstly, we need to generate a JWT access token using the following command:
curl -v "https://api.aspose.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=CLIENT_ID&client_secret=CLIENT_SECRET" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
Step 2: Call the MPP to PDF Conversion API
Now execute the following command to export MS Project (MPP) file to PDF online.
curl -X GET "https://api.aspose.cloud/v3.0/tasks/{sourceMPP}/format?format=pdf" \
-H "accept: multipart/form-data" \
-H "authorization: Bearer <JWT_Token>" \
-o {resultantFile}
Replace:
sourceFile
with the name of your MPP file stored in cloud.<JWT_Token>
with the token received in step 1.
MPP to PDF Converter App
You can try MPP to PDF conversion online using our free MPP to PDF Converter, which is built on top of our REST APIs.
Free MPP to PDF converter online.
Conclusion
Whether you’re using the Node.js SDK or the REST API with cURL, converting MPP to PDF is simple, reliable, and highly efficient. It improves accessibility, enables seamless sharing, and maintains formatting across platforms—ideal for project reporting and client communication.
Useful Links
Related Articles
We highly recommend visiting the following blogs: