<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d8211560\x26blogName\x3dTech+Tips,+Tricks+%26+Trivia\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttp://mvark.blogspot.com/search\x26blogLocale\x3den\x26v\x3d2\x26homepageUrl\x3dhttp://mvark.blogspot.com/\x26vt\x3d-5147029996388199615', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Tech Tips, Tricks & Trivia

by 'Anil' Radhakrishna
An architect's notes, experiments, discoveries and annotated bookmarks.

Search from over a hundred HOW TO articles, Tips and Tricks


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.

Labels:

Tweet this | Google+ it | Share on FB

« Home | Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »

»

Post a Comment