0

I want to view a PDF-file on an HTML page by using Base64 and an iFrame. When I upload a PDF-file with less than 1kb it works, anything above that number does not. Test view by object data doesn’t work either.

  • possible duplicate https://stackoverflow.com/questions/291813/recommended-way-to-embed-pdf-in-html?rq=1 – Dev Dec 28 '19 at 21:21

1 Answers1

0

Concern to big pdf file size:

1. On Server site:
   Reduce the file size by using any compression method with output is stream string. (Be better to cache the compressed file).

2. On Client site:
   Uncompress the compressed string (ie. using pako js) to pdf format and display it in the iframe.

Enjoy Buddy!

OO7
  • 660
  • 4
  • 10
  • But my problem not in upload I think not need riduce file because I tried downloading file between display the process complete. but the problem in set base 64 in ifram src =.... – Ahmad Abuhejleh Dec 28 '19 at 22:08
  • You means it needs to be decoded into regular pdf format? – OO7 Dec 28 '19 at 22:16
  • Mention to big pdf size you can also use any slide show inside the iframe, so the file could be split into several string stream over several client request. – OO7 Dec 28 '19 at 22:23