In general we are going to embed pdf in html. For this tutorial I am going to use PDF.js. It is a web platform for parsing and rendering PDF files. Canvas support is one of the main things that is needed by PDF.js.
Get the PDF library:
Get stable or beta release from http://mozilla.github.io/pdf.js/getting_started/#download. Upload the library to the site you are going to use it on. Basically this is HTML5 embed PDF reader / viewer.Pure HTML version:
Source code viewer
class="pdf" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" frameborder="no" width="100%" height="600px" src="http://example.com/pdf.js/web/viewer.html?file=http%3A%2F%2Fexample.com%2Fembed.pdf" data-src="http://example.com/embed.pdf"> http://example.com/embed.pdf </iframe>Programming Language: HTML5
PHP version:
Source code viewer
$pdf_url = 'http://example.com/embed.pdf'; $width = '100%'; $height = '600px'; echo '<iframe class="pdf" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" frameborder="no" width="'.$width.'" height="'.$height.'" data-src="'.$pdf_url.'"> '.$pdf_url.' </iframe>';Programming Language: PHP