An API that connects multiple Microsoft services, enabling data access and automation across platforms
Graph content?format=pdf drops hyperlinks when the document is 2 or 3 pages long
We convert DOCX files to PDF server-side with GET /users/{id}/drive/items/{item-id}/content?format=pdf. Hyperlinks go missing in the PDF, but only for documents of 2 or 3 pages:
| Pages | Link annotations per page (2 expected on every page) |
|---|---|
| 1 | 2 |
| 2 | 0, 2 |
| 3 | 2, 0, 0 |
| 4 | 2, 2, 2, 2 |
| 5 | 2, 2, 2, 2, 2 |
| 6 | 2, 2, 2, 2, 2, 2 |
The test files are minimal DOCX files built from scratch: one heading and two ordinary hyperlinks (w:hyperlink, external relationship) per page, pages separated by a hard page break. They differ only in page count. The text renders fine; only the link annotations are missing.
A real 3-page document (headers/footers, images, no hard page breaks) shows the same pattern: only the links on page 1 survive, and adding a fourth page fixes it. Desktop Word (Microsoft 365 Apps 16.0.20527.20088, Save As PDF) keeps all links for the same files.
This looks like the page-count-dependent link loss that was reported for desktop Word in 2021–2022 (for example https://learn.microsoft.com/en-us/answers/questions/5155032/word-save-as-pdf-breaks-hyperlinks), but now in the server-side conversion.
Questions:
- Is this a known issue in the Graph / OneDrive conversion service?
- Is there any supported way to preserve hyperlinks with this endpoint, since it accepts no conversion options?
Minimal repro files and a curl script are available on request.