DevSendData

<< Click to Display Table of Contents >>

Navigation:  Device Control Properties >

DevSendData

Previous pageReturn to chapter overviewNext page

[Windows platform only; not supported by PHP and the Community Edition]

This method enables your application to send printer dependent Escape-Sequences (control sequences and binary data) directly to the printer. Because the data you send with this method is strictly printer dependent, you must know to what printer model you are printing.

With this method it is possible, to select for example an output paper bin by code (or whatever other functionality is provided by the connected printer).

method long VPE.DevSendData(

string Data

)

string Data

the string with the data

Returns:

Value

Description

True

success

False

failure

Remarks:

In case of an error, LastError is set to VERR_COMMON. An error may occur if the device does not support sending binary data.

 

ActiveX: You may only call this function while processing the event DoPrintDevData().

 

VCL: You may only call this function while processing the event OnPrintDevData().

 

.NET: You may only call this function while processing the event PrintDevData().

In C# the values true and false are not compatible with the integer datatype.
Use 1 for true and 0 for false.

 

If you call DevSendData() while not processing the event, the method does nothing.

Example:

Example in Visual Basic (while processing the DoPrintDevData() event):

ActiveX:

Const RevLandScape = "&l3O"  ' PCL command to change the Paper

                            ' orientation to Reverse Landscape.

PCL_Escape$ = Chr$(27) + RevLandScape

Doc.DevSendData(PCL_Escape$)

ResultingAction = PRINT_ACTION_CHANGE

 

.NET:

const string RevLandScape = "&l3O"        // PCL command to change the Paper

                                                         // orientation to Reverse Landscape.

PCL_Escape = Chr(27) + RevLandScape

Doc.DevSendData(PCL_Escape)

event.PrintResultingAction = PrintResultingAction.Change

The characters in the string are: "&" + the letter "l" + "3" + the letter "O"