Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Open PDFjs as base64 string
// wrapper for base64 param
window.openPdfAsBase64 = function (base64) {
var binary_string = window.atob(base64);
var len = binary_string.length;
var bytes = new Uint8Array(len);
for (var i = 0; i < len; i++) {
bytes[i] = binary_string.charCodeAt(i);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment