Click here to Skip to main content
15,884,177 members
Please Sign up or sign in to vote.
1.55/5 (3 votes)
Hi,

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,
Zeeshan.
Posted
Comments
Sergey Alexandrovich Kryukov 17-Sep-13 16:20pm    
Are you really rendering it on a server side? To what format?
—SA
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.

Thanks.
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?

—SA
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?
—SA

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.

—SA
 
Share this answer
 

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