Embed a Blob using PDFObject

后端 未结 3 1175
南笙
南笙 2021-01-06 06:41

I\'m using: https://pdfobject.com/

To display an embedded pdf file on my web app. However I cannot render a pdf created from a blob

3条回答
  •  无人及你
    2021-01-06 07:30

    Just a complement to the answer by using iframe, we need also to use pdfjs viewer on this otherwise it will download.

    The blob is created from binary response creates with Javascript

    const url = window.URL.createObjectURL(new Blob([response], { type: 'application/pdf' }));
    

    I do hope PDFObject can do the work without using iframe but as tested, it's not success.

提交回复
热议问题