File limits in PDF generation using Microsoft Graph API

Peter Black 1 Reputation point

We are converting an Excel file to PDF by uploading to SharePoint using the Graph API, then downloading using format=pdf. This has been working fine for most files, but fails for a spreadsheet with 2007 rows (317kb in size). When converted manually in Excel 365 the file produces a PDF of 462 pages. Clearly we can alter the settings we pass to reduce the number of pages, but it would be helpful to understand what the service API limits are (given it does actually work in Excel 365).

The API request we're using is:

theInputStream = theGraphClient.sites(aSiteId).drives( .items(;

The error log contains the error XLSPageLimitExceeded. Can anyone explain what the value of the limit is? Also, Is there a limitation for the generation for:

  1. File size
  2. Number of rows
  3. Number of columns
  4. Number of cells
  5. Number of sheets

Or anything else? Thanks so much!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,381 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Deva-MSFT 2,256 Reputation points Microsoft Employee

    Adding a similar thread which i answered it earlier!!