You can retrieve the base64 string representation of a PDF file in the same way.
For iOS apps, you can construct a data URL like data:application/pdf;base64, base64StringHere
to open the PDF in the device browser.
/* holder of the link to the PDF
/* when you have the base64 string use it as a value of the href attribute to construct the link*/
img = document.getElementById(
img.href = src;
For Android devices, a more robust solution would be:
- Get the base64 string
- Convert the base64 string to a byte/binary array
- Save it to the device file storage as a file
- Open the PDF from the device file storage
You can refer to this example app
for reading a local PDF file. You can also use the File Transfer
plugin to write the base64 string to the local storage.
I hope that this helps. Let me know if you have questions.