0

I want to creating web like library that user just read not to download,

For example :

I include file.pdf in admin page, and view.html in home page, <a href="pdffile.pdf"> PDF 1 here </a> please help me to solve my proble.

I'm using codeigniter

1
  • 2
    You have to do some more effort here...
    – Masiorama
    Commented May 7, 2015 at 7:59

1 Answer 1

2

What you're asking for isn't that easy to do. If a visitor of your site can read a PDF in their browser, depends largely on two factors: Whether the browser can display PDFs at all, and how the browser is configured to deal with them.

Current versions of most browsers can display PDFs natively. But older browsers are still around. Some of those older browsers can't handle PDFs at all, some use a plugin, some hand PDFs over to an external reader software. According to the statistics of a website I manage, more than 40% of all visits are done with browsers that have a plugin for PDF installed.

The second factor is how your visitors have configured their browsers. With most browsers, you can configure something like "for this type of content, do this; for that type of content, do that". So if a visitor of your site configured their browser to download content of type PDF, there's not much you can do about it ;)

What you can do: You can have your site suggest what the browser and/or the person sitting in front of the screen may do. For this purpose, you might want to read up on the HTTP header Content-Disposition. Whether your visitors follow that suggestion or not, is up to them and the software they use.

2
  • oke thank you, for idea is www.scribd.com, on the website, can display ebook just trial ebook and can display ebook with full ebook. i think that the website using pdf to display, how to create like that??
    – Aan Elzam
    Commented May 7, 2015 at 11:55
  • 1
    I'm afraid you guessed wrong, scribd.com isn't using PDF for display. If you look into the source code of a page, you'll see that the content is built in HTML with images etc. And even though I don't have insider knowledge from the inner workings of scribd.com, you can savely assume that a large number of people worked for a long time to create that site. That's not done in one afternoon with one short explanation on Stackoverflow, I'm afraid. Commented May 7, 2015 at 18:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.