alesdario
alesdario

Reputation: 1894

Browsing PDF in a web page without using Flash

I Have an N-Pages PDF linked in a my web page.

I want to be able to browse the PDF, with next and prev arrows, page numbers, etc etc

I want to be able to browse the PDF without using any Flash Plugin.

I also want to normalize the browsing behaviour, so i don't want to use the default PDF plugin of the browser.

I'm looking for a JS plugin but i don't find interesting solutions.

Any other suggestions?

Upvotes: 0

Views: 528

Answers (1)

coder
coder

Reputation: 13248

You can try this way:

See my code below:

 $("a[href*=.pdf]").click(function(){
    window.open(this.href);
    return false;
});

Alternatively, you can apply the target="_self" attribute instead:

 $("a[href*=.pdf]").click(function(){
    $(this).attr({"target":"_self"});
    return false;
});

EDIT:

If you need a plugin here it is https://github.com/andreasgal/pdf.js

Demo for the plugin http://deanhume.com/content/postimages/pdfjs/pdfjs.htm#1

Upvotes: 1

Related Questions