Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 342 Bytes

render_pdf_in_pdf_view.md

File metadata and controls

13 lines (11 loc) · 342 Bytes

Render PDF in PDF view

// Fetch raw binary PDF data
const response = await fetch('https://some.pdf');
// Extract response body as Blob
const blob = await response.blob();
// Create an URL pointing to the object
const url = URL.createObjectURL(blob);

// Render a PDF viewer
// <object data={url} type="application/pdf"></object>