Skip to content

Instantly share code, notes, and snippets.

@farskid
Created November 22, 2018 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save farskid/4bebd569fe107db5e4e825975c741395 to your computer and use it in GitHub Desktop.
Save farskid/4bebd569fe107db5e4e825975c741395 to your computer and use it in GitHub Desktop.
PDF reader in javascript
async function pdfViewer(pdfSrc) {
let blob = await fetch(pdfSrc);
blob = fetched.blob();
const url = URL.createObjectURL(blob);
return <object data={url} type="application/pdf"></object>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment