3

Planning to use Object tag to display pdf file inline in HTML file. Is this recommended? Or are there any pitfall for this approach; anyone can point out e.g. Browser compatibility, Security

user1687711
  • 443
  • 1
  • 4
  • 13

2 Answers2

2

Looks like its been supported well for a while: http://joliclic.free.fr/html/object-tag/en/object-application.html#pdf

Brett Zamir
  • 14,034
  • 6
  • 54
  • 77
  • Totally agree with your assessment. I was going in same direction.. If this is a standard feature than it should be supported by simple javascript.. It looks like it is supported by all the browser too.. I strongly feel this is good feature to leverage.. Thanks again for you response – user1687711 Sep 21 '12 at 13:40
  • In case you were not clear as a new user, you can mark one of our answers as the "answer" if you are happy with it. – Brett Zamir Sep 21 '12 at 14:27
1

There is hardly any specific recommendation on this, either way in published specifications. Technical issues include:

  1. Not every computer has a PDF viewer (in a manner that makes the browser able to launch it).
  2. Quite often, people report problems when a web browser tries to open a PDF file (launch a viewer for it), even in cases where the PDF viewer can open the file OK if it has been saved on local disk first.
  3. PDF documents, especially when embedded inside an HTML document, do not work well in small displays. (Try opening one on a smartphone.)
  4. PDF is, as a rule, less accessible than HTML format.
  5. PDFs embedded in HTML documents are not common, which implies that people may have usability problems with them, even if they are familiar with a PDF viewer. This depends on exactly how a browsers launches a PDF viewer to display the document.
Jukka K. Korpela
  • 195,524
  • 37
  • 270
  • 390
  • 1
    Thanks for you response; though not sure why you need pdf viewer if it is part of standard specification.. As pointed out in next answer alt : test.pdf Should work... Please let me know if you see any issue with this... Having said that I tend to agree with point 4 and first hard of point 5 about usability.. Do you have any data that would prove the same.. Again Appreciate your response.. – user1687711 Sep 21 '12 at 13:35
  • 1
    Browsers display PDF documents via PDF viewers. No standard requires them to do so, any more than to support some other non-HTML data format. – Jukka K. Korpela Sep 21 '12 at 16:53