Winform _ about Printing

Source: Internet
Author: User

1. printdocument

The document object that contains the printed content page. This object is used for previewing and printing. Therefore, this object is the most important in the print function.

1> printpreviewdialog. Document = printdocument;

Printpreviewdialog. showdialog (); --- the preview window is displayed.

2> printdocument. Print () --- print directly

3> During previewing and printing, the printpage event of this object needs to be triggered (during multi-Page Preview and printing, check whether the event is complete at the end of the event; otherwise, print E. hasmorepages = true;). The event parameter printpageeventargs contains the required information for previewing and printing.

2. printpreviewdialog

Print preview window components

1> after the preview window is opened, it is a small window by default. The visual effect is not very good. To set the preview window size, you need to set the width and height attributes of this object;

2> you can set the attributes of the printpreviewcontrol object on the preview page;

3. printpreviewcontrol

Print the containers that contain pages in the preview window

1> if multiple pages are printed, You need to drag the scroll bar to preview each page separately. You need to set the rows attribute of this object. The preview page contains multiple pages based on the rows value;

2> after the preview window is opened, the default zoom ratio of the page to be previewed is 0.3, which is not visually good. You can set the zoom attribute of this object to 1, and the page can be enlarged according to the zoom ratio of 100%;

4. pagesetupdialog

Page settings for previewing and printing. Common settings include page margin settings, horizontal and vertical settings.

5. printdialog

Set the printer, including the hardware device that selects the output content and the number of copies.

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.