JavaScript: print, print, preview, and print settings _ javascript skills

Source: Internet
Author: User
This article mainly introduces how to print, print, preview, and print settings in JavaScript. For more information, see WebBrowser, which is a built-in browser control of IE. you do not need to download it.

I. WebBrowser control

II. WebBrowder control method // Print

WebBrowser1.ExecWB (6, 1 );

// Print settings

WebBrowser1.ExecWB (8, 1 );

// Print and preview

WebBrowser1.ExecWB (7,1 );

There are other usage examples of this component:

WebBrowser. ExecWB () open Web. ExecWB () close all existing IE windows and open a new window Web. ExecWB)

Save Web pages. ExecWB (6, 1) print Web. ExecWB (7, 1) print preview Web. ExecWB (8, 1)

Print Page settings Web. ExecWB (10, 1)

View page properties Web. ExecWB)

It seems to be Undo. to be confirmed, Web. ExecWB (17,1)

Select all Web. ExecWB () to refresh Web. ExecWB)

When the form is closed, no prompt is displayed, but printing will print the entire page. the page will display everything. sometimes we only need to print the data table, now we have to write a style:

Hide the part that you do not want to print: style content:

Then you can use the style:

No printing required

The code is as follows:

The code is as follows:


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.