HOW TO mimic Google Search/GMail's “View as HTML” feature to browse PDFs/Word docs online

I often feel tricked after clicking a link that does not indicate it's a PDF & I'm whisked away. It's distracting and also frustating when you realise that the material you have downloaded is not even useful. I feel a PDF should be offered through a website mainly when it's purpose is for it to be preserved offline or to provide well-formatted content which is not possible to be shown through HTML due to browser inadequacies. I think it's good netiquette for publishers to indicate explicitly to readers when there is a hyperlink to an non-HTML file format like PDF by labelling links.

I love the PDF / Word to HTML conversion feature that Google Search & GMail offer with the “View as HTML” link whenever you encounter a PDF or Word file in search results or in email attachments.

I noticed that unlike most file-format-conversion-service providers (thanks Amit) which require users to upload PDF files they want to convert, some like the SamurajData service allow you to specify a URL to fetch the PDF from. As it uses the submitted URL as a querystring, it is possible to extend this beautiful service for programmatic use. All you need to do is append the URL of the PDF or Word doc that you want to convert to the URL of the program on SamurajData ( http://view.samurajdata.se/ps.php?url= ) that does the conversion. You can set the TARGET attribute of the hyperlink to "_blank" to make it open in a new window.

Comments