'Combining content from multiple pages using OneNote Graph API

I would like to generate a PDF using content from multiple OneNote pages. I am accessing these pages through Microsoft Graph API. To get content, I know of the following endpoint:

/onenote/{pageId}/content?includeIDs=true&includeInkML=true

However, the returned content contains elements that are positioned absolutely, and I can't think of a way to combine the content from multiple pages while maintaining the positioning of the absolute elements with respect to the pages they originally came from.

To generate the PDF, I am using the following post as a reference: Auto-Convert OneNote to PDF

It outlines the following steps:

  1. Render the content to an HTML Canvas
  2. Render ink to canvas using InkMLjs
  3. Convert canvas to a PDF using something like the following library: https://github.com/joshua-gould/canvas2pdf

I can envision this working if the content is specific to one page, but it will not work across multiple pages with absolute positioned elements. Is there a way to generate a PDF with this content that would accomplish this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source