PDFJs Viewer.html into a div

leonardorame picture leonardorame · Jun 26, 2015 · Viewed 9.2k times · Source

Does anyone know if viewer.html from pdf.js (http://mozilla.github.io/pdf.js/web/viewer.html) can be placed inside a <div>?.

Or better yet, converted to an AngularJs directive (I know there are a couple of pdfjs directives for Angular, but none of them has the quality of viewer.html).

Answer

H&#249;ng Trần picture Hùng Trần · Aug 3, 2018

Put your src of pdf file in iframe like this :

<div><iframe src="/pdfjs/viewer.html/{src of PDF file}" style="position: relative;   top: 0;  bottom: 0; left: 0;   width: 100%;   height: 700px;  border: 0"></iframe></div>

it may help you