masterFly
masterFly

Reputation: 1112

Show pdf file content as a viewer

I want to have a PDF viewer. I have the pdf file content in hand (Not the PDF File).

How can I display it as a pdf viewer. Like in pdfjs.

Please help.

Thanks in advance

Upvotes: 0

Views: 284

Answers (1)

masterFly
masterFly

Reputation: 1112

I figure it out. PDFjs still does the trick. When we have pdf content in hand we can give a backend script file name as the src for pdfjs.

Ex: openpdf.php

Then just echo (output) the pdf content as the response. Make sure to use the content type as "applicatoin/pdf" in response header.

Thats it... Cheers...!!!

Upvotes: 1

Related Questions