2.2.4.34.19 PageBase::Print

Description

Print the page.

Syntax

BOOL Print( TreeNode & tn )

Parameters

tn
[input]Tree node which stores settings related to printing.

Return

Returns TRUE on success and FALSE on failure.

Examples

EX1

void PageBase_Print_ex1()
{
    GraphPage gp = Project.GraphPages(0);                                // Page to print
    if( gp )
    {
        Tree tree;
        tree.Printing.PrinterName.strVal = "Canon Bubble-Jet BJC-2000";    // Ignore default printer, use Canon instead
        tree.Printing.NumberOfCopies.nVal = 2;                            // Print 2 copies
        tree.Printing.DPI.nVal = 300;                                    // Resolution 300 dpi
        BOOL bResult = gp.Print(tree);
    }
}

EX2

print notes window
void NotesPage_Print_ex1()
{
	PageBase pg = Project.ActivePageBase();
    if( pg )
    {
        Tree tree;
        tree.Pdf.FileName.strVal = "C:\\test.pdf";
        //0: print to pdf then print to the default printer
        //1: print to pdf only
        tree.Pdf.PrintMode.nVal = 1;
        BOOL bResult = pg.Print(tree);
    }
}

Remark

See Also

Header to Include

origin.h