Handling PDF files using ASP

Hi all,
Is there a way (using a component) in ASP or ASP.NET that you can show a PDF file off the server and show it in the browser (i.e on a webpage) WITHOUT the user having to download it?

Alternatively is there a component available that can convert PDF files into good quality JPG or HTM/ASP pages on the fly? i.e. when the user requests the file?

I need to be able to deal with 15-20 page PDFs, but as some users are on a dial up connection it would take too long to download the entire file and I don't want to have to go down the road of splitting the file into sections!  Any other suggestions or thoughts are welcome!

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi rtuplin,

Before trying whatever, just remember that the browser MUST download the full file before showing it. I mean, suppose you find a way to show a PDF file on the browser. The user opens a page, and it shows the PDF file. When this is done, the full page is downloaded! If your problem is the slow connection, the result is EXACTLY the same as if the file was downloaded by a button or a hyperlink, or whatever.
If you convert it to JPG, it's even worst, because a PDF file converted to JPG is bigger then the original.

rtuplinAuthor Commented:
Hi diasf,
Yes appreciate that.  I was hoping there might be a component available that could pass PDF pages to a browser a page at a time, there by resolving the speed issue!

The idea behind converting the PDF to JPG files is that each JPG would be a single page of the PDF, there by reducing the download time that the user has to wait before he see's the page he's waiting for. i.e. it would only download a page at a time, not the full file.

Does it have to be on the fly?  Have you got that many PDFs flying in and out of your data store?  Or could you do some sort of late-night batch convert and turn the PDFs into HTML files, so the user can choose which they prefer -- a download or a web page?

Google does something very similar (though the formatting requires some attention!) and from looking that the "view as html" links they have, they're searching a cache so I reckon they might to something very similar: a batch convert on spidered PDF files.

Googling for "convert pdf to html" has come up with a number of solutions, some more expensive than others...
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

rtuplinAuthor Commented:
Hi Cirieno,
On average its 1, possibly 2 PDF files a week, but because they will arrive from different users, it needs to be some kind of server component to deal with it rather than a set of user procedures!

A late-nite batch job would be ideal and my perfect scenario is to convert the files into a HTML format with low res images.  The PDFs themselves are created using Adobe Insign CS2 and contain both text and images, but would I suspect convert with no major issues into HTML tables.

At present our site is ASP, but we do have full access to Visual Studio.NET so the section of the site which displays the PDF/HTML/ASP/JPG (delete as appropriate!!!) files could be .NET coded if the technology is better.

I'll have a look at google!


Yes, you could convert PDF to JPG, thus dowloading a page at a time. But still, the PDF-page is much shorter in file size as the same JPG-page. Maybe you could separate PDF files page-by-page. Can you?

Also, look at Cirieno hint, to convert to HTML. That's the shortest kind of file.

There is a feature in Adobe Acrobat that allows you to set a document as "Fast Web View".  Here is what it says in the Help File:

Allow Fast Web view displays PDFs from the Web one page at a time. If this option is not selected, the entire PDF will download before it is displayed.

It looks like Adobe Acrobat has the capability to run batch processes as well.  There is probably some way you could set it up to go through a directory and enable each document for fast web view.  As far as other formats, the only one that makes ANY improvement on size is .png  I just converted a 98K pdf to a .png file and it is now 94K   All other formats, at least doubled the size of the file.  So if there is no significant gain and you can get the pdf to download one page at a time, that would be the way to go.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.