EPLAN.EPLAN21.PRINT

Contents

Description

Command for printing projects or pages on the current standard printer.

The EPLAN.EPLAN21.PRINT command is called up via the API functions as specified in the EPLAN 21 API.

Parameters

All parameters have the prefix "EPL_PARAM_PRINT_".

ParameterID Type Description
PROJECT [IN, OPTIONAL]
EplHandle
Handle of a project to be printed. (optional, instead of PROJECTS, PAGE or PAGES)
PROJECTS [IN, OPTIONAL]
EplHandle
Handle of a project iterator with projects to be printed. (optional, instead of PROJECT, PAGE or PAGES)
PAGE [IN, OPTIONAL]
EplHandle
Handle of a page to be printed. (optional, instead of PROJECT, PROJECTS or PAGES)
PAGES [IN, OPTIONAL]
EplHandle
Handle of a page iterator with pages to be printed. (optional, instead of PROJECT, PROJECTS or PAGE)
COPIES [IN, OPTIONAL]
Integer
Number of copies to be printed per page. Maximum 100.

1: (default)

COLLATE [IN, OPTIONAL]
Boolean
Activate/deactivate sorting of pages to be printed.

1: Pages are sorted.
0: Pages are not sorted (default)

Error Messages

The eplExecuteCommand function returns EPL_OK if the objects could be successfully printed.

If the command fails, eplExecuteCommand returns the value EPL_ERROR. In this case, the error log can contain the following errors:

ErrorID Description
EPL_ERR_FAILED Printing could not be carried out. A fatal error occurred.
EPL_ERR_INVALID_ARGUMENT No suitable parameter (PROJECT, PROJECTS, PAGE, PAGES) was handed over.
EPL_ERR_PRINT_INVALID_COLLATE_FLAG An invalid collate flag was handed over.

Example

The following example shows a function which prints a page on the current standard printer. The handle of the page object must be determined first.

bool
printPage(EplSession hSession, EplHandle hPage)
{
    bool bRet = false;

    //Create PRINT command
    EplHandle hCmdPrint = eplCreateCommand(hSession, L"EPLAN.EPLAN21.PRINT");

    if(hCmdPrint != EPL_ERROR)
    {
        //Set parameters
        //
        //Page handle
        eplSetHandleParam(hSession,
                          hCmdPrint,
                          EPL_PARAM_PRINT_PAGE,
                          hPage,
                          0);

        //Execute command
        if(eplExecuteCommand(hSession, hCmdPrint) != EPL_ERROR;
        {
            bRet = eplTRUE;
        }

        eplCloseObject(hSession, hCmdPrint);
    }

    return bRet;
}

Reference