Solve several problems in printing

Source: Internet
Author: User
Tags client
Printing | Solving problems about solving printing problems in a page
/*
Tofu production is a boutique
Http://www.asp888.net Tofu Technology Station
If reproduced please retain the full copyright information
*/
We all know that today's B/s application more and more, we do the procedure often encounter needs to print the report of the situation, but
We know that it is difficult to control the client printer of IE, except for the Window.print control. No
Any other way, and sometimes we have to be preview first, then print, sometimes we also have to page setup after
To print, how to do?

Some friends may have found that, under IE's File menu, these are all available, but how to invoke these menus through scripting programs?
After Cafecat sample's hint, finally found that the use of an ActiveX control can achieve this function, please see the following code
<object classid=clsid:8856f961-340a-11d0-a96b-00c04fd705a2 height=0 ID=WB width=0></object>
This object is actually Iewebbrowser set Width and Height, we can not see the shape of the control in the interface

Then we can use this object to implement our paper selection and preview function.
<script language= "JavaScript" >
function Doprintsetup () {
Print settings
WB. EXECWB (8,1)
}
function DoPrintPreview () {
Print Preview
WB. EXECWB (7,1)
}

</script>

Of course, this does not completely solve the problem of client printing, tofu will be in the future article on this issue for further discussion



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.