Hide

SftPrintPreview/OCX 1.0 - ActiveX Print Preview Control

Display
Print

SftPrintPreviewRenderingInfo

Contains information needed to render one page.

Syntax

VB.NETStructure SftPrintPreviewRenderingInfo
Dim Function As SftPrintPreviewRenderContentConstantsFunction RenderContent event must perform
Dim RealPrinter As BooleanFunction RenderContent event must perform
Dim Positioning As BooleanPositioning Only
Dim hDC As IntegerOutput Device Context
Dim hDCPrinter As IntegerPrinter Device Context
Dim hwndContent As IntegerWindow Providing Content (Attributes + Data)
Dim hwndData As IntegerWindow Providing Content (Data Only)
Dim CurrentPage As IntegerCurrent Page Number (0..n)
Dim LastPage As IntegerLast Known Page (0..n)
Dim PageRectPrinterPix As tagRECTPage rectangle (entire page) in pixels
Dim PageRectPrinter As SftRectFloatPage rectangle (entire page) in inches
Dim PrintableRectPrinterPix As tagRECTPrintable portion of page in pixels
Dim PrintableRectPrinter As SftRectFloatPrintable portion of page in inches
Dim MarginRectPrinterPix As tagRECTPrintable area defined inside user-defined margins in pixels
Dim MarginRectPrinter As SftRectFloatPrintable area defined inside user-defined margins in inches
Dim ClientRectPix As tagRECTCurrent page in pixels
Dim ClientRect As SftRectFloatCurrent page in inches
Dim OutputRectDisplayPix As tagRECTOutput area in pixels
Dim OutputRectDisplay As SftRectFloatOutput area in inches
Dim ContentSizing As SftPrintPreviewContentSizingConstantsDesired content sizing
Dim ContentWidthPix As IntegerBest content width in pixels
Dim ContentWidth As SingleBest content width in inches
Dim ContentHeightPix As IntegerBest content height in pixels
Dim ContentHeight As SingleBest content height in inches
Dim MaxContentWidthPix As IntegerMaximum content width in pixels
Dim MaxContentWidth As SingleMaximum content width in inches
Dim MaxContentHeightPix As IntegerMaximum content height in pixels
Dim MaxContentHeight As SingleMaximum content height in inches
Dim RenderingWorkArea As LongApplication-defined workarea
Dim PreviousVisitedPageInfo As ObjectInfo for previous page (preceding current page)
Dim VisitedPageInfo As ObjectInfo for the current page if available
End Structure
VBType SftPrintPreviewRenderingInfo
Function As SftPrintPreviewRenderContentConstantsFunction RenderContent event must perform
RealPrinter As BooleanFunction RenderContent event must perform
Positioning As BooleanPositioning Only
hDC As LongOutput Device Context
hDCPrinter As LongPrinter Device Context
hwndContent As LongWindow Providing Content (Attributes + Data)
hwndData As LongWindow Providing Content (Data Only)
CurrentPage As LongCurrent Page Number (0..n)
LastPage As LongLast Known Page (0..n)
PageRectPrinterPix As tagRECTPage rectangle (entire page) in pixels
PageRectPrinter As SftRectFloatPage rectangle (entire page) in inches
PrintableRectPrinterPix As tagRECTPrintable portion of page in pixels
PrintableRectPrinter As SftRectFloatPrintable portion of page in inches
MarginRectPrinterPix As tagRECTPrintable area defined inside user-defined margins in pixels
MarginRectPrinter As SftRectFloatPrintable area defined inside user-defined margins in inches
ClientRectPix As tagRECTCurrent page in pixels
ClientRect As SftRectFloatCurrent page in inches
OutputRectDisplayPix As tagRECTOutput area in pixels
OutputRectDisplay As SftRectFloatOutput area in inches
ContentSizing As SftPrintPreviewContentSizingConstantsDesired content sizing
ContentWidthPix As IntegerBest content width in pixels
ContentWidth As SingleBest content width in inches
ContentHeightPix As IntegerBest content height in pixels
ContentHeight As SingleBest content height in inches
MaxContentWidthPix As IntegerMaximum content width in pixels
MaxContentWidth As SingleMaximum content width in inches
MaxContentHeightPix As IntegerMaximum content height in pixels
MaxContentHeight As SingleMaximum content height in inches
RenderingWorkArea As LongApplication-defined workarea
PreviousVisitedPageInfo As VariantInfo for previous page (preceding current page)
VisitedPageInfo As VariantInfo for the current page if available
End Type
C#.NETstruct SftPrintPreviewRenderingInfo {
SftPrintPreviewRenderContentConstants Function;Function RenderContent event must perform
bool RealPrinter;Function RenderContent event must perform
bool Positioning;Positioning Only
int hDC;Output Device Context
int hDCPrinter;Printer Device Context
int hwndContent;Window Providing Content (Attributes + Data)
int hwndData;Window Providing Content (Data Only)
int CurrentPage;Current Page Number (0..n)
int LastPage;Last Known Page (0..n)
tagRECT PageRectPrinterPix;Page rectangle (entire page) in pixels
SftRectFloat PageRectPrinter;Page rectangle (entire page) in inches
tagRECT PrintableRectPrinterPix;Printable portion of page in pixels
SftRectFloat PrintableRectPrinter;Printable portion of page in inches
tagRECT MarginRectPrinterPix;Printable area defined inside user-defined margins in pixels
SftRectFloat MarginRectPrinter;Printable area defined inside user-defined margins in inches
tagRECT ClientRectPix;Current page in pixels
SftRectFloat ClientRect;Current page in inches
tagRECT OutputRectDisplayPix;Output area in pixels
SftRectFloat OutputRectDisplay;Output area in inches
SftPrintPreviewContentSizingConstants ContentSizing;Desired content sizing
int ContentWidthPix;Best content width in pixels
float ContentWidth;Best content width in inches
int ContentHeightPix;Best content height in pixels
float ContentHeight;Best content height in inches
int MaxContentWidthPix;Maximum content width in pixels
float MaxContentWidth;Maximum content width in inches
int MaxContentHeightPix;Maximum content height in pixels
float MaxContentHeight;Maximum content height in inches
int RenderingWorkArea;Application-defined workarea
object PreviousVisitedPageInfo;Info for previous page (preceding current page)
object VisitedPageInfo;Info for the current page if available
};
C, C++struct SftPrintPreviewRenderingInfo {
enum SftPrintPreviewRenderContentConstants Function;Function RenderContent event must perform
VARIANT_BOOL RealPrinter;Function RenderContent event must perform
VARIANT_BOOL Positioning;Positioning Only
long hDC;Output Device Context
long hDCPrinter;Printer Device Context
long hwndContent;Window Providing Content (Attributes + Data)
long hwndData;Window Providing Content (Data Only)
long CurrentPage;Current Page Number (0..n)
long LastPage;Last Known Page (0..n)
struct tagRECT PageRectPrinterPix;Page rectangle (entire page) in pixels
struct SftRectFloat PageRectPrinter;Page rectangle (entire page) in inches
struct tagRECT PrintableRectPrinterPix;Printable portion of page in pixels
struct SftRectFloat PrintableRectPrinter;Printable portion of page in inches
struct tagRECT MarginRectPrinterPix;Printable area defined inside user-defined margins in pixels
struct SftRectFloat MarginRectPrinter;Printable area defined inside user-defined margins in inches
struct tagRECT ClientRectPix;Current page in pixels
struct SftRectFloat ClientRect;Current page in inches
struct tagRECT OutputRectDisplayPix;Output area in pixels
struct SftRectFloat OutputRectDisplay;Output area in inches
enum SftPrintPreviewContentSizingConstants ContentSizing;Desired content sizing
int ContentWidthPix;Best content width in pixels
float ContentWidth;Best content width in inches
int ContentHeightPix;Best content height in pixels
float ContentHeight;Best content height in inches
int MaxContentWidthPix;Maximum content width in pixels
float MaxContentWidth;Maximum content width in inches
int MaxContentHeightPix;Maximum content height in pixels
float MaxContentHeight;Maximum content height in inches
long RenderingWorkArea;Application-defined workarea
const _variant_t& PreviousVisitedPageInfo;Info for previous page (preceding current page)
const _variant_t& VisitedPageInfo;Info for the current page if available
};

Members

Function

Defines the function the RenderContent event must perform (see SftPrintPreviewRenderContentConstants).

RealPrinter

Set to True if printing to a real printer (i.e., not preview display), False otherwise.

Positioning

Set to True if the RenderContent event is called for formatting purposes only to subsequently render a later page, False otherwise.

hDC

Defines the output device context. All output is rendered using this device context.

hDCPrinter

Defines the printer device context. When generating a preview display, the output device context hDC describes a screen device or metafile context. To query attributes of the actual printer device, the hDCPrinter device context must be used.

hwndContent

Defines the window handle, describing the window to be rendered. Same as ContentProvider property.

hwndData

Defines the window handle, describing the window to be rendered. Same as DataProvider property.

CurrentPage

Defines the current page being rendered. Page numbers are zero-based.

LastPage

Defines the currently last know (visited) page. Page numbers are zero-based.

PageRectPrinterPix

A rectangle describing the dimensions of the page in printer coordinates (in pixels).

PageRectPrinter

A rectangle describing the dimensions of the page (in inches).

PrintableRectPrinterPix

A rectangle describing the dimensions of the physically printable area on the page in printer coordinates (in pixels).

PrintableRectPrinter

A rectangle describing the dimensions of the physically printable area on the page (in inches).

MarginRectPrinterPix

A rectangle describing the dimensions of the printable area, excluding all margins, on the page in printer coordinates (in pixels).

MarginRectPrinter

A rectangle describing the dimensions of the printable area, excluding all margins, on the page (in inches).

ClientRectPix

A rectangle describing the dimensions of the printable area, excluding all margins, on the page in printer coordinates (pixels). This area is available for any application-generated output and reflects the actual output area of the output device context hDC.

ClientRect

A rectangle describing the dimensions of the printable area, excluding all margins, on the page (in inches). This area is available for any application-generated output and reflects the actual output area of the output device context hDC.

OutputRectDisplayPix

A rectangle describing the dimensions of the printable area, excluding all margins, on the page (in pixels).

OutputRectDisplay

A rectangle describing the dimensions of the printable area, excluding all margins, on the page (in inches).

ContentSizing

Desired content sizing as defines using the ContentSizing property.

ContentWidthPix

Reserved for future use. Defines the best width for the current output (in pixels).

ContentWidth

Reserved for future use. Defines the best width for the current output (in inches).

ContentHeightPix

Reserved for future use. Defines the best height for the current output (in pixels).

ContentHeight

Reserved for future use. Defines the best height for the current output (in inches).

MaxContentWidthPix

Reserved for future use. Defines the maximum available width for the current output (in pixels).

MaxContentWidth

Reserved for future use. Defines the maximum available width for the current output (in inches).

MaxContentHeightPix

Reserved for future use. Defines the maximum available height for the current output (in pixels).

MaxContentHeight

Reserved for future use. Defines the maximum available height for the current output (in inches).

RenderingWorkArea

The RenderingWorkArea value is defined using the ContentProviderCallback or ContentProviderCallbackX method and is only valid while handling a RenderContent event. It is used to hold an application-specific value.

PreviousVisitedPageInfo

When the RenderContent event is called with a Function of renderSftPrintPreview_1Page, the information returned as the VisitedPageInfo value in the RenderContent event for the preceding page is available to the application in the PreviousVisitedPageInfo member.

VisitedPageInfo

When the RenderContent event is called with a Function of renderSftPrintPreview_1Page, the information returned as the VisitedPageInfo value in the RenderContent event for the current page CurrentPage during a prior RenderContent event is made available.

Examples

C++

    MessageBox(_T("Sorry, this sample doesn't offer a help file"));
}

void CSftPrintPreviewDlg::OnRenderContentSftPrintPreview1(long Function, long FAR* LastPage, VARIANT FAR* VisitedPageInfo)
{
    // This function is called by SftPrintPreview to print pages, to initialize and
    // terminate printing (to prepare and free resources) and for page positioning
    if (Function == renderSftPrintPreview_Init) {
        SftPrintPreviewRenderingInfo I = m_vPrintPreview1->GetRenderingInfo();
        int height = MulDiv(10, GetDeviceCaps((HDC)I.hDCPrinter, LOGPIXELSY), 72);// 10 point font
        m_PrintFont.CreateFont(- height, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET,
                OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FF_DONTCARE|DEFAULT_PITCH,
                _T("Arial"));
        _ASSERT(m_PrintFont.m_hObject);
    } else if (Function == renderSftPrintPreview_Term)
        m_PrintFont.DeleteObject();

See Also Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.