Share via

GraphClient PDF conversion incorrectly adding blank pages

Chris Clarkson 0 Reputation points
2026-01-21T11:53:52.19+00:00

I use GraphClient to convert docx files into PDF through our SharePoint, this has been working correctly for the last year or so.

This morning, it appears that when converting documents, its adding a blank pages incorrectly, I dont think this was happening yesterday.

 

I have tried a few test documents, when converting in desktop word or online word, neither have the blank page, it is only when using the GraphClient that this happens.

Microsoft 365 and Office | SharePoint | Development
0 comments No comments

1 answer

Sort by: Most helpful
  1. Steven-N 25,305 Reputation points Microsoft External Staff Moderator
    2026-01-21T13:06:35.5833333+00:00

    Hi Chris Clarkson

    Thank you for reaching out to Microsoft Q&A

    As far as I know, this behavior typically caused by differences in how the Graph API’s PDF conversion engine interprets document layout, particularly with elements like section breaks, page margins, and font substitutions.

    Therefore, to mitigate this behavior, you can follow the below suggestion workarounds:

    1/ Review your DOCX files for:

    Review your DOCX files for formatting elements that may trigger pagination issues during conversion. Specifically, check for the use of “Odd page” section breaks, which can introduce filler pages to maintain publishing conventions.

    Additionally, look for excessive empty paragraphs or trailing line breaks at the end of the document, as well as wide tables or images that may exceed page boundaries these can all contribute to unexpected blank pages in the resulting PDF.

    2/ Adjust formatting:

    You can replace “Odd page” section breaks with “Next page” breaks where appropriate to prevent automatic blank page insertion. Standardize fonts throughout the document and ensure they are properly embedded to avoid layout shifts.

    Finally, define explicit page sizes and margins in the DOCX file to help the Graph API’s rendering engine interpret the layout more consistently during PDF generation.

    Link references:

    https://learn.microsoft.com/en-us/graph/api/driveitem-get-content-format?view=graph-rest-1.0&tabs=http

    https://learn.microsoft.com/en-gb/answers/questions/5562717/graph-api-docx-to-pdf-conversion

    You can try the above workaround method, if the problem still persists, kindly let me know in the comments for further support.


    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.