0

I want to use an API that's used to sign documents. This API has a field that requires a bas64 XML document. I know I can use Buffer.from(myString).toString('base64') to get base64 from a string, but I have no idea how to convert a PDF to XML. All I could find until now was a paid solution, meaning I'd have to send the PDF to an external server (which is undesirable).

mdmb
  • 4,833
  • 7
  • 42
  • 90
  • many signing APIs would ask for base64 encoded document, may not ask for XML. can you recheck the API documentation and any examples they have given? converting PDF doc to base64 string is [possible](https://stackoverflow.com/questions/43083955/what-is-the-best-way-to-convert-a-pdf-file-into-base64binary/43084065#43084065), and makes sense. – Anand Sowmithiran Nov 29 '21 at 11:01
  • example of one of the popular document [signing](https://developers.docusign.com/docs/esign-rest-api/how-to/converting-pdf/) API asking for `base64` encoded string of the document to be signed. – Anand Sowmithiran Nov 29 '21 at 11:02

0 Answers0