How to open a PDF file in a browser and implement a preview of ideas and code

Source: Internet
Author: User

In fact, it is simple to implement an open PDF file in the browser and have a border similar to the preview function.

In fact, often see similar pages on the Internet, open PDF documents in the browser, but most of the reasons for the use of copyright because of some very special technology, naturally difficult to imitate.
Even if you have an example that opens directly in the browser, you must manually click on the link before you can open the PDF file. How do I open it directly without clicking on the link?
I think I am very familiar with JS, also use JS analog click, but is not useful, no way, can only continue to look for information on the Internet. Finally, the code is very simple.
The main thing is to use a jquery plug-in jquery.media.js, the use of this plug-in is very easy to achieve.
Core code:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.