0

Hey guys I am new at Front End Development. I want to display my pdf file from byte array like:

<embed id="preview_pdf" src=' +myitem + "?#zoom=85&scrollbar=0&toolbar=0&navpanes=0" +  ' frameborder="0" oncontextmenu="return false" onselectstart="return false" ondragstart="return false" allowfullscreen >' + '</embed>');

how it is possible for me ?

2
  • Does this answer your question? Display PDF within web browser Commented Sep 3, 2021 at 7:58
  • Sadly no since im getting my pdf file as byte array and want to display that pdf file from database Commented Sep 3, 2021 at 8:01

1 Answer 1

2

The Adobe Embed API can be used to display PDF files in modern browsers and can accept a Promise that resolves to an array buffer as input. The important part of the code might look like this...

adobeDCView.previewFile({
    content: { promise: Promise.resolve(buffer) }
    metaData: { fileName: :"myFile.pdf" }
}); 

It's free.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.