Do I render PDF into HTML, to be printable?
Posted: Thu Oct 13, 2016 10:12 am
I have been asked if there is a way to extract data from the DB, show people's details, and then within the same row, show the PDF that's been uploaded on screen, so the whole page is printable.
The idea is they can select a month of choice, which they can then print off for various authorities.
I've tried this:
While it shows it on screen, it's not printable.
I also thought about doing it with an iframe, but a) I'm not sure if that will work and b) with iframe, you have to set a height and width. What if the document is taller than the iframe?
Is it not possible?
The idea is they can select a month of choice, which they can then print off for various authorities.
I've tried this:
Code: Select all
<div id="pdf">
<object width="50%" height="500" type="application/pdf" data="/test.pdf?#zoom=50&scrollbar=0&toolbar=0&navpanes=0" id="pdf_content">
<p>Insert your error message here, if the PDF cannot be displayed.</p>
</object>
</div>I also thought about doing it with an iframe, but a) I'm not sure if that will work and b) with iframe, you have to set a height and width. What if the document is taller than the iframe?
Is it not possible?