I'm working on a PHP project, that has all the content stored in PDF files with the very well arranged format, so I don't wanna convert or rewrite into HTML. Is there a way to view pdf directly from server one by one page without downloading the complete file?
Asked
Active
Viewed 149 times
1 Answers
0
Download PDFObject library from https://pdfobject.com/ and check the below code: I hope it will work you.
<!DOCTYPE html>
<html>
<head>
<title>Pdf Read</title>
<style>
.pdfobject-container { height: 500px;}
.pdfobject { border: 1px solid #666; }
</style>
<script src="pdfobject.min.js"></script>
</head>
<body>
<div id="example1"></div>
<script>PDFObject.embed("pdfread.pdf", "#example1");</script>
</body>
</html>

Ravi Shrimali
- 111
- 1
- 9
-
It's not what I want, clientside js will download complete file from the server then render view, but in my case, I want to parse the pdf in server so a user won't have to download complete pdf, we want to load one page at a time in the browser to load fast. The server has to send one page at a time and when a user clicks next send next page, not the complete file. Some of pdfs are larger than 30 megabytes so for this scenario, this is worst option for me, – Shivam Verma Jan 07 '18 at 06:33