Click here to Skip to main content
14,825,162 members
Please Sign up or sign in to vote.
1.55/5 (3 votes)

I am looking to add pdf viewer to site that will display selected pdf files.

But it should not loading completely & display at once rather it should display as it loads & loads accordingly as we scroll for fast rendering.

I came across pdf.js but hangs up on how to use it in my site due to absence of documentation.

If any one has solution to this or has implemented pdf.js successfully kindly let me know as it will be highly appreciated.

If you are unclear please ask.

Thanks & Regards,
Sergey Alexandrovich Kryukov 17-Sep-13 16:20pm
Are you really rendering it on a server side? To what format?
Zeeshan17 27-Sep-13 11:36am
Thanks for your response.

What is required is to display pdf file (pdf pages) as it is been fetched from server rather than fetching it at once & then displaying.

Hopefully i am clear this time else please ask if you have any doubt.

Sergey Alexandrovich Kryukov 27-Sep-13 12:57pm
"Add PDF viewer" means that you are required not to rely on the software on client side, how it's usually done, because in fact the users are not obliged to have such viewer, it is not part of a browser.
If this is so, it means that you have to re-work PDF content into, say, HTML. But it all depends on what do you have for server-side technology. You did not mention a word about it. Doing it by a client-side script... possible, too, yes, PDF.js, but... why?

Zeeshan17 29-Sep-13 11:40am
I am using ASP.Net & yes i have used pdf.js it works good but the problem is it fetches the pdf completely from server & then renders the pages.So i need to render the page as it fetch from server that will load the page along side the fetching the pdf.
Sergey Alexandrovich Kryukov 29-Sep-13 12:00pm
It all depends on your scenario. If the PDF is fixed or rarely modified, you can have a fix rendering of it on the server side. Again, do you want to render it as HTML? or what?
Zeeshan17 30-Sep-13 12:09pm
Yes the PDF will be fixed they will not be modified.I don't need it to render in HTML.
Can you tell me in more detail about what you want to say about "fix rendering of it on the server side" Kindly explain.

Zeeshan17 30-Sep-13 12:14pm
Yes PDF will be fixed & will not be modified.I am not looking to render it to html

Can you please explain in more detail about what you mean by 'fix rendering of it on the server side' & the way to do it.

Zeeshan17 3-Oct-13 8:10am
How will you render PDF to html for faster display.

See my basic requirement is the PDF file should be displayed as it is being fetched from server that is in progressive/incremental way like our webpages loads that as the data is fetched it is displayed rather in pdf it is completely fetched & then displayed.

Rendering to anything will do but it must address my requirement.


1 solution

Please see my comments to the question.

Not looking to render PDF as HTML? Then how do you want to render PDF? You cannot reasonably ask: "how to render PDF as PDF?". :-) Do you understand the point?

You can rely upon rendering PDF by the browser. If the browser does not support it (PDF is not a part of any Web standards, but some browsers support it, usually by a plug-in, which may or may not be installed), it will prompt the user for default action: save or load with default application. If the user does not have such application, no luck. As simple as that.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900