Graph Api is not formatting html to PDF

Roopam Dutta 0 Reputation points
2024-05-17T05:02:59.45+00:00

Hi,

we are using graph api to convert html document into PDF, it was working before but now all the images in the div comes on top left corner overlapped. could anyone please help on this.

Saved HTML DOC:

User's image

PDF converted using Graph:

User's image

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

1 answer

Sort by: Most helpful
  1. awijekoon 1,410 Reputation points Microsoft Vendor
    2024-05-19T21:09:23.5966667+00:00

    Hi Roopam,

    What API are you using for this task?

    According to below Graph API documentation, It does not show Html as supported source extensions for Pdf format

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

    These are some issues related to the OneDrive API, which might be helpful to figure out the issueUser's image

    https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_get_content_format?view=odsp-graph-online#known-issues-with-html-to-pdf-conversion

    0 comments No comments