Background: We run several websites for classified ads. One of them gets some of the ads from an external source as PDF files. We know PDFs aren't ideal, but we have to deal with them somehow.

Question: Is there any good way to embed PDFs? Or an other smart way to handle it? (at the moment we have a short explanation and link to the original PDF - but that's not very elegant...).

Remarks: I tested embedding in several browsers and they all seem to handle it differently. Also I can't find any stats on PDF reader plugin penetration (plus there are other plugins like Foxit Reader; Chrome even has bult in PDF support).

  • Please remember that Safari/Firefox users on Mac seldom have any third-party app for reading embedded pdfs. The built-in one works of course, but will not show the pdf in an embedded state. Jun 7, 2011 at 13:39
  • Thanks for the hint. I'm a Mac user myself... do you have any stats on PDF reader plugin penetration on Mac? Couldn't find anything :(
    – Phil
    Jun 7, 2011 at 13:48
  • Is there a reason you linked to Wikipedia for classified ads? Just curious. Jun 7, 2011 at 13:52
  • 1
    stackoverflow.com/questions/291813/… seems like a related/possible duplicate question.
    – calum_b
    Jun 7, 2011 at 14:04
  • @Charles: Yep, I wasn't sure if everybody understands "classified ads". Maybe I should have added the wiki link in brackets next to the term...?
    – Phil
    Jun 7, 2011 at 14:06

3 Answers 3


After looking at the different solutions (thanks Sam for you recommendations!) and the thread on stackoverflow.com (thanks Calum for the find!) we'll go with Google Docs Viewer.

It's JavaScript instead of flash and it doesn't require to upload the PDFs anywhere.

Update: The Google Docs Viewer does not work properly in IE9 (at least we couldn't find a working solution yet). Pity.

Update II: The Google Docs Viewer causes even more trouble: Sometimes it also doesn't work in other browsers (including Chrome). It's hard to say why, my guess is that the users disabled the Google Viewer in their Google account and are logged in (but I don't even know if that's possible, hard to tell...). After deleting the cookies and logging out it usually works again. We'll try to investigate further....

Update III: We didn't find any real solutions. Using (ugly) workarounds for the time being. If we find anything I'll update this answer.


Is relying on the browser handling the tag not an option? As you say, they all do it differently and it also depends on what's installed on the machine. But anything that handles PDFs will probably rely on the configuration of the client computer.

If you want more control over it, you've a couple of options. Firstly, for more manageable control of how they're displayed, you could purchase something like Atalasoft to display PDFs within your website (irrespective of which browser someone is using).

Alternatively, you could purchase something (e.g. Aspose) which will allow you to parse the PDFs server side and extract the text/imagery from them (which you'd then display in a more appropriate way to your end users).

  • 1
    Thanks for your answer. Relying on the browser handling isn't really an option for me because I just don't know if it works properly for most users. Converting PDFs to images does have a few drawbacks (SEO; loss of quality and vectors font). Converting PDFs to HTML sounds great - but does it really work? Any experience with Aspose? (luckily our system runs on .NET, so it could be the right solution).
    – Phil
    Jun 7, 2011 at 13:26
  • Yes. It's an excellent piece of kit. Admittedly, we use it in one of our enterprise solutions to go the other way - converting various text and file types to PDF. I guess the amount of effort required in using it is probably linked to the quality of the source files. But I recommend it as a product.
    – Sam K
    Jun 8, 2011 at 7:33

Crocodoc converts PDF to HTML pretty well and allows to embed them. While the main feature of Crocodoc is to allow comments on files, you can set it up so it's just embed on your page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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