Share via

Doc (Microsoft Office Word HTML document) to PDF conversion is failing via MS Graph API

Kapil Virdi 0 Reputation points
2025-04-30T12:42:58.85+00:00

Hello Everyone,

Doc (Microsoft Office Word HTML document) to PDF conversion is failing via MS Graph API while same conversion works if done manually by uploading the document to SharePoint site and exporting it as PDF.

Steps to recreate the issue:

  1. Change doc_to_pdf_conversion_failed.txt extension to doc_to_pdf_conversion_failed.doc
  2. Use MS Graph API to upload to a SharePoint site
  3. Use MS Graph API to export it to PDF, this step fails
  4. We have an open ticket TrackingID#2502210040010117, it has detailed information

Steps to manually export to pdf:

  1. Change doc_to_pdf_conversion_failed.txt extension to doc_to_pdf_conversion_failed.doc
  2. Manually upload to SharePoint API
  3. Click to preview
  4. Click Download as PDF, this succeeds
Microsoft Security | Microsoft Graph
0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2025-05-26T20:23:29.8+00:00

    Hello @Kapil Virdi

    Basic Conversion Endpoint:

    • You can use the following endpoint to convert a Word document to PDF:
      Use Postman or Graph Explorer as per your convenience.
      GET /drive/items/{item-id}/content?format=pdf
    • Replace {item-id} with the ID of the Word document you want to convert 
    1. Detailed Steps:

    Additionally,

    GET /drive/items/{item-id}/content?format=pdf
    

    If the above do not help, please feel free to reach out to Microsoft Support with the error logs which has the client request id, request id and timestamp of the failed Graph Request.

     

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    1. Basic Conversion Endpoint:
      • You can use the following endpoint to convert a Word document to PDF:
        GET /drive/items/{item-id}/content?format=pdf
        • Replace {item-id} with the ID of the Word document you want to convert 
        1. Detailed Steps:

    Additionally,

    GET /drive/items/{item-id}/content?format=pdf
    

    If the above do not help, please feel free to reach out to Microsoft Support with the error logs which has the client request id, request id and timestamp of the failed Graph Request.

     

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    Was this answer helpful?

    0 comments No comments

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.