How to save PDF document to Based64?

I have a use case where I need to load the PDF document and then press a button to trigger saving function.
the saving function will translate the PDF to based64.

is there any code sample for angular?

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:


This guide shows how you can get the PDF data as an ArrayBuffer

That code goes on to create a Blob, but you can stop at this line where it’s an ArrayBuffer
const data = await doc.getFileData(options);

Then you could use an approach like this to convert the ArrayBuffer to base64 javascript - ArrayBuffer to base64 encoded string - Stack Overflow