0

I am creating pages in onenote, using the Microsoft Graph API, which works fine with plain HTML.

To create a multipart page like here Create Onenote page with MS Graph API, the API expects binary data. I wanted to attach a multi page PDF file, but how do I get the binary data from it. Just opening with a texteditor end copying the plain text does not work.

Oakley
  • 3
  • 3
  • This would be absolutely okay for me. The problem is that I don't know how to get the binary data from the PDF. Some articles say, that base64 conversion is not necessary but copying the file contents from an editor is not working either. – Oakley Apr 14 '22 at 10:05
  • You are right. I am rendering jpgs from the pdf and create the page in html an insert the images via – Oakley Apr 15 '22 at 11:38
  • how are you creating the request? - I use php with curl requests. This works for inserting pdfs as expected. The pdf is loaded into a variable which is inserted into the body of the request. I use the onenote-api as the graph-api has a 4MB limit – codeye Apr 18 '22 at 14:45

0 Answers0