Rendering MS Project Document

Note
Note: The features listed in this page are supported only in GroupDocs.Viewer Cloud V1

Starting from GroupDocs.Viewer Cloud 18.2 two new options have been added which allows to adjust Page Size and Time Unit when rendering MS Project documents. By default GroupDocs.Viewer API tries to find optimal output size and time unit, depending on the projects overall length, depending on the projects overall length. In case you need to set your own page size or time unit, you can specify ProjectOptions which provides two options PageSize and TimeUnit.  Time unit refers to smallest unit (days, third of a month or month) used in timescale bar, when the TimeUnit = “Days” is set you will get the most detailed view of your tasks and opposite, when TimeUnit = “Month” is set you will get more general representation of tasks. This example demonstrates how to create pages cache as HTML with provided ProjectOptions.

NOTE: ProjectOptions is supported by all methods which accepts DocumentInfoOptionsImageOptionsHtmlOptions and PdfFileOptions objects.

The following GroupDocs.Viewer Cloud REST API resource has been used to create document cache as HTML.

cURL example

curl -v "https://api.groupdocs.cloud/v1/viewer/sample.mpp/html/pages" \
-X POST \
-H "Content-Type: application/json" \
-d "{"projectOptions": {"pageSize": "A0","timeUnit": "unknown"}}" \
-H "authorization: Bearer [Access Token]"
{
  "fileName": "sample.mpp",
  "folder": null,
  "pages": [
    {
      "number": 1,
      "resources": [],
      "url": "http://api.groupdocs.cloud/v1/viewer/sample.mpp/html/pages/1"
    }
  ]
}

SDK examples

The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.

Rendering MS Project Document Pages as Image

Starting from GroupDocs.Viewer Cloud 18.2 two new options have been added which allows to adjust Page Size and Time Unit when rendering MS Project documents. By default GroupDocs.Viewer API tries to find optimal output size and time unit, depending on the projects overall length, depending on the projects overall length. In case you need to set your own page size or time unit, you can specify ProjectOptions which provides two options PageSize and TimeUnit.  Time unit refers to smallest unit (days, third of a month or month) used in timescale bar, when the TimeUnit = “Days” is set you will get the most detailed view of your tasks and opposite, when TimeUnit = “Month” is set you will get more general representation of tasks. This example demonstrates how to create pages cache as Image with provided ProjectOptions.

NOTE: ProjectOptions is supported by all methods which accepts DocumentInfoOptionsImageOptionsHtmlOptions and PdfFileOptions objects.

The following GroupDocs.Viewer Cloud REST API resource has been used to create document cache as HTML.

cURL example

curl -v "https://api.groupdocs.cloud/v1/viewer/sample.mpp/image/pages" \
-X POST \
-H "Content-Type: application/json" \
-d "{"projectOptions": {"pageSize": "A0","timeUnit": "unknown"}}" \
-H "authorization: Bearer [Access Token]"
{
  "fileName": "sample.mpp",
  "folder": null,
  "pages": [
    {
      "number": 1,
      "resources": [],
      "url": "http://api.groupdocs.cloud/v1/viewer/sample.mpp/html/pages/1"
    }
  ]
}

SDK examples

The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.

Render MS Project documents by specifying Project Start and End dates

Since the version 18.11 GroupDocs.Viewer Cloud API allows to render part of MS Project  document according to specified StartDate and EndDate properties of ProjectOptions class as shown in examples below. When only one of this properties is set, rendering starts from project start or to end date correspondingly.

NOTE: ProjectOptions is supported by all methods which accepts DocumentInfoOptionsImageOptionsHtmlOptions and PdfFileOptions objects.

The following GroupDocs.Viewer Cloud REST API resource has been used to create document cache as HTML.

cURL example

curl --request POST \
  --url https://api.groupdocs.cloud/v1/viewer/sample.mpp/html/pages \
  --header 'authorization: Bearer [Access Token]' \
  --header 'content-type: application/json' \
  --data '{"projectOptions": {"startDate": "07/01/2008","endDate": "07/31/2008"}}'
{
  "fileName": "sample.mpp",
  "pages": [
    {
      "number": 1,
      "resources": [
        {
          "name": "styles.css",
          "url": "http://api.groupdocs.cloud/v1/viewer/sample.mpp/html/pages/1/resources/styles.css"
        },
        {
          "name": "image.png",
          "url": "http://api.groupdocs.cloud/v1/viewer/sample.mpp/html/pages/1/resources/image.png"
        },
        {
          "name": "image1.png",
          "url": "http://api.groupdocs.cloud/v1/viewer/sample.mpp/html/pages/1/resources/image1.png"
        },
        {
          "name": "image2.png",
          "url": "http://api.groupdocs.cloud/v1/viewer/sample.mpp/html/pages/1/resources/image2.png"
        },
        {
          "name": "graphics.svg",
          "url": "http://api.groupdocs.cloud/v1/viewer/sample.mpp/html/pages/1/resources/graphics.svg"
        },
        {
          "name": "font.ttf",
          "url": "http://api.groupdocs.cloud/v1/viewer/sample.mpp/html/pages/1/resources/font.ttf"
        },
        {
          "name": "font1.ttf",
          "url": "http://api.groupdocs.cloud/v1/viewer/sample.mpp/html/pages/1/resources/font1.ttf"
        }
      ],
      "url": "http://api.groupdocs.cloud/v1/viewer/sample.mpp/html/pages/1"
    }
  ]
}

SDK examples

The API is completely independent of your operating system, database system or development language. We provide and support API SDKs in many development languages in order to make it even easier to integrate. You can see our available SDKs list here.