JS print html specified element, solve the dynamically acquired picture can't print problem

Source: Internet
Author: User

Using JS to invoke the browser's print interface is easy, one or two lines of code can be done, but some of the data is generated dynamically, such as some dynamically generated QR code, sometimes called Print interface pictures will not be displayed
To solve this problem, it is recommended to use the following library
Download: Https://github.com/tanathos/jquery.jqprint

<  script src< Span class= "OP" >=   "jquery.jqprint-0.3.js"  />  <SCRIPT>  $   (  ' #youid '   .jqprint   ( {  Debug:false,// If true, you can display the IFrame view effect (the IFRAME default height and width are very small, can be increased in the source code), the default is False   Importcss:true,// True to introduce the original page of the CSS, the default is true   Printcontainer:true,// Indicates that if the original selected object must be included in the print (note: setting to false may break your CSS rules).   operasupport:true//indicates that if the plugin must also support the Opera browser, in this case it provides a temporary print tab. The default is true  }  )  ;  </script  >   

JS Print html specified element, solve the dynamically acquired picture cannot print problem

Related Article

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.