Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

newbie question - how to open all links to pdf files in pdf.js viewer?

602 views
Skip to first unread message

namei

unread,
Feb 16, 2013, 11:37:14 PM2/16/13
to
hello,

1. i am wanting to open all links to pdf files on a web page in pdf.js viewer in a new page.

2. it would also be great if the pdf file links weren't visible when hovering over them or were somehow obfuscated to prevent direct download etc.

could anyone please help me get started?

i have downloaded the zip file from github (https://github.com/mozilla/pdf.js)and gone to both of the index.html files in the examples folder and get blank pages when opening either of these files.

if exact steps and code examples could be provided it would be much appreciated.

thank you very much.

christian...@gmail.com

unread,
Apr 27, 2013, 5:24:59 AM4/27/13
to
It's quite easy, everytime you link on an PDF, replace the link by
<Path to viewer.html>?file=<path to PDF URL-Encoded>
f.e.
http://me/pdf.js/web/viewer.html?file=/dir/subdir/filename.pdf

exper...@gmail.com

unread,
Jun 7, 2013, 2:45:59 AM6/7/13
to
Hi,
I am also facing issue with pdf.js on chrome and mozila browser

I have linked an PDF path to encoded URL,Here is my line

<html>
<body>
<iframe src="http://mozilla.github.io/pdf.js/web/viewer.html?file=http
%3A%2F%2Fwww.liferay.com%2Fdocuments %2F31578%2F11925632%2Fsample.pdf" width="500" height="400"></iframe>
</body>
</html>

Thanks for your time.
Regards
Biswajit
0 new messages