Call IE built-in print components to complete the Web printing scheme and routines

Source: Internet
Author: User
Web|web print calls IE built-in print components complete Web printing scheme and routines (10.28)

Focus:
<object id=webbrowser classid=clsid:8856f961-340a-11d0-a96b-00c04fd705a2 height=0 width=0 VIEWASTEXT>
</OBJECT>
<input Type=button value= Print onclick= "Document.all.WebBrowser.ExecWB (6,1)" class= "noprint" >
<input Type=button value= Direct Print onclick= "Document.all.WebBrowser.ExecWB (6,6)" class= "noprint" >
<input Type=button value= Page Setup onclick= "Document.all.WebBrowser.ExecWB (8,1)" class= "noprint" >
<input Type=button value= Print Preview onclick= "Document.all.WebBrowser.ExecWB (7,1)" class= "noprint" >

Attention:
1, the CSS for printing control:
<!--Media=print This property can be effective when printing-->
<style media=print>
. Noprint{display:none;}
. Pagenext{page-break-after:always;}
</style>

The noprint style makes it very important that the print buttons on the page not appear on the printed page, because it can perform the most needed functions with minimal code

Pagenext style can be set paging, where the need for paging <div class= "Pagenext" ></div> on OK, hehe

2, the table line thickness of the settings, but also through the style sheet:

<style>
. TDP
{
Border-bottom:1 solid #000000;
Border-left:1 solid #000000;
border-right:0 solid #ffffff;
border-top:0 solid #ffffff;
}
. TABP
{
Border-color: #000000;

Border-collapse:collapse;
}
</style>

Or:

<style>
. TDCS1 {
Border:solid windowtext 1.0pt;
}
. TDCS2 {
Border:solid windowtext 1.0pt; Border-left:none;
}
. TDCS3 {
Border-top:none;
Border-left:solid windowtext 1.0pt;
Border-bottom:solid windowtext 1.0pt;
Border-right:solid windowtext 1.0pt;
}
. TDCS4 {
Border-top:none;
Border-left:none;
Border-bottom:solid windowtext 1.0pt;
Border-right:solid windowtext 1.0pt;
}
. underline {
Border-top-style:none;
Border-right-style:none;
Border-bottom-style:solid;
Border-left-style:none;
Border-bottom-color: #000000;
}
</style>



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.