Partager via


CPrintInfo Structure

Stores information about a print or print-preview job.

struct CPrintInfo

Members

Public Methods

Name

Description

CPrintInfo::GetFromPage

Returns the number of the first page being printed.

CPrintInfo::GetMaxPage

Returns the number of the last page of the document.

CPrintInfo::GetMinPage

Returns the number of the first page of the document.

CPrintInfo::GetOffsetPage

Returns the number of the pages preceding the first page of a DocObject item being printed in a combined DocObject print job.

CPrintInfo::GetToPage

Returns the number of the last page being printed.

CPrintInfo::SetMaxPage

Sets the number of the last page of the document.

CPrintInfo::SetMinPage

Sets the number of the first page of the document.

Public Data Members

Name

Description

CPrintInfo::m_bContinuePrinting

Contains a flag indicating whether the framework should continue the print loop.

CPrintInfo::m_bDirect

Contains a flag indicating whether the document is being printed directly (without displaying the Print dialog box).

CPrintInfo::m_bDocObject

Contains a flag indicating whether the document being printed is a DocObject.

CPrintInfo::m_bPreview

Contains a flag indicating whether the document is being previewed.

CPrintInfo::m_dwFlags

Specifies DocObject printing operations.

CPrintInfo::m_lpUserData

Contains a pointer to a user-created structure.

CPrintInfo::m_nCurPage

Identifies the number of the page currently being printed.

CPrintInfo::m_nJobNumber

Specifies the job number assigned by the operating system for the current print job

CPrintInfo::m_nNumPreviewPages

Identifies the number of pages displayed in the preview window; either 1 or 2.

CPrintInfo::m_nOffsetPage

Specifies offset of a particular DocObject's first page in a combined DocObject print job.

CPrintInfo::m_pPD

Contains a pointer to the CPrintDialog object used for the Print dialog box.

CPrintInfo::m_rectDraw

Specifies a rectangle defining the current usable page area.

CPrintInfo::m_strPageDesc

Contains a format string for page-number display.

Remarks

CPrintInfo is a structure and does not have a base class.

The framework creates an object of CPrintInfo each time the Print or Print Preview command is chosen and destroys it when the command is completed.

CPrintInfo contains information about both the print job as a whole, such as the range of pages to be printed, and the current status of the print job, such as the page currently being printed. Some information is stored in an associated CPrintDialog object; this object contains the values entered by the user in the Print dialog box.

A CPrintInfo object is passed between the framework and your view class during the printing process and is used to exchange information between the two. For example, the framework informs the view class which page of the document to print by assigning a value to the m_nCurPage member of CPrintInfo; the view class retrieves the value and performs the actual printing of the specified page.

Another example is the case in which the length of the document is not known until it is printed. In this situation, the view class tests for the end of the document each time a page is printed. When the end is reached, the view class sets the m_bContinuePrinting member of CPrintInfo to FALSE; this informs the framework to stop the print loop.

CPrintInfo is used by the member functions of CView listed under "See Also." For more information about the printing architecture provided by the Microsoft Foundation Class Library, see Frame Windows and Document/View Architecture and the articles Printing and Printing: Multipage Documents.

Inheritance Hierarchy

CPrintInfo

Requirements

Header: afxext.h

See Also

Reference

Hierarchy Chart

CView::OnBeginPrinting

CView::OnEndPrinting

CView::OnEndPrintPreview

CView::OnPrepareDC

CView::OnPreparePrinting

CView::OnPrint

Concepts

MFC Sample DIBLOOK