0% found this document useful (0 votes)
23 views

UtilityPrinterDriver SDK specification Ver1.06E

The Sanei Utility Printer Driver SDK User's Guide provides detailed information on the SDK's functions, including SDK version retrieval, RAW data control, printer status management, format settings, and macro settings. It outlines the functions available for controlling printer operations and managing printer status, along with sample programs for practical implementation. The guide is intended for developers looking to integrate printer functionalities into their applications using the Sanei Utility Printer Driver.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

UtilityPrinterDriver SDK specification Ver1.06E

The Sanei Utility Printer Driver SDK User's Guide provides detailed information on the SDK's functions, including SDK version retrieval, RAW data control, printer status management, format settings, and macro settings. It outlines the functions available for controlling printer operations and managing printer status, along with sample programs for practical implementation. The guide is intended for developers looking to integrate printer functionalities into their applications using the Sanei Utility Printer Driver.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Sanei Utility Printer Driver

for SDK
User’s guide
MODEL: SK1-41
SK1-31
SK1-21

Rev1.06 1509
Contents

1. Overview of function of SDK..............................................................................................................................3


2. SDK version getting function.............................................................................................................................4
int GetApiVersion( ) ..........................................................................................................................................4
3. RAW data control function.................................................................................................................................5
bool WriteRawData(string printer, byte[] pBytes, Int32 dwCount) .................................................................5
4. Printer status getting function ..........................................................................................................................6
bool GetPrinterStatus(string printer, ref int status) ........................................................................................6
5. Printer status manager control function...........................................................................................................7
bool EnableLM() ..................................................................................................................................................7
bool DisableLM() .................................................................................................................................................7
6. Format setting function .....................................................................................................................................8
bool GetDriverFormat(string printer,ref UpdDriverFormat df).......................................................................8
bool SetDriverFormat(string printer,ref UpdDriverFormat df) .......................................................................8
7. Macro setting function .......................................................................................................................................9
bool GetMacroData(string printer,int type,ref int num,ref int[] data).............................................................9
bool SetMacroData(string printer,int type,int num,int[] data) ......................................................................10
8. About define......................................................................................................................................................11
9. Sample program ...............................................................................................................................................12
1. Overview of function of SDK
Sanei Utility Printer Driver for SDK is support class library enabled the software control for API.
This is composed of 1 file mentioned below.

Class Library File: UpdSdk.dll

This SDK consists of mainly six functions as follows.

ƒ SDK version getting function.


ƒ RAW data control function.
ƒ Printer status getting function.
ƒ Printer status manager control function.
ƒ Format setting function.
ƒ Macro setting function.

SDK version getting function


Function name Function
GetApiVersion Get SDK version

RAW data control function


Function name Function
WriteRawData Write RAW data.

Printer status getting function


Function name Function
GetPrinterStatus Get printer status.

Printer status manager control function


Function name Function
EnableLM Enable printer status manager.
DisableLM Disable printer status manager.

Format setting function


Function name Function
GetDriverFormat Get format setting data.
SetDriverFormat Set format setting data.

Macro setting function


Function name Function
GetMacroData Get macro data.
SetMacroData Set macro data.

-3-
2. SDK version getting function

int GetApiVersion( )

Function Get SDK version.

Return Version number

Remark If version number is 1.02, the return value is 102.

-4-
3. RAW data control function
bool WriteRawData(string printer, byte[] pBytes, Int32 dwCount)

Function Write RAW data into printer.


string printer Specify printer handle.
byte[] pBytes Input RAW data.
Int32 dwCount Input RAW data length (BYTE).

Return true Succeeded


false Failed

-5-
4. Printer status getting function
bool GetPrinterStatus(string printer, ref int status)

Function Get printer status


string printer Specify the name of printer.
int status Printer status is set.

Return true Succeeded


false Failed

Remark Refer the chapter “About define” as for the details of status variable.

-6-
5. Printer status manager control function
This control function enables or disables function of printer status manager. Default setting is ENABLED.
Function of printer status manager is monitoring printer error status (as ‘no paper’) on a PC.
Please see a document “Sanei Utility Printer Driver for Windows, section 4 Status monitor”.
If interactive communication between PC and printer by user is driven independently, this function has to be
stopped because the communication cannot work.

bool EnableLM()

Function Enable printer status manager.

Return true Succeeded


false Failed

bool DisableLM()

Function Disable printer status manager.

Return true Succeeded


true Error occurred

-7-
6. Format setting function
This function controls the format setting into the property with SaneiUtilityPrinterDriver.
The structure of format is written in Class Library and it is mentioned as follows.

public struct UpdDriverFormat


{
public int Initialize; // Initialize
public int PaperWidth; // Paper width
public int Density; // Density
public int PaperSetting; // Paper settings
public int ReversePrint; // Reverse printing
public int Compress; // Compressed printing
public int WaterMark; // Water mark printing
public int E_journal; // Electronic journal
public int Autores; // Auto status response output
public int First; // Logo head printing
public int Remote; // Remote function
public int Mail; // Mail function
public int Timeout; // Time out of retracting function
public int Mode; // Presenter operation mode
}

bool GetDriverFormat(string printer,ref UpdDriverFormat df)

Function Get format data and put into the structure.


string printer Specify the name of printer.
UpdDriverFormat df Format information is set.

Return true Succeeded


false Failed

Remark Refer the chapter “About define” as for the details of df member.

bool SetDriverFormat(string printer,ref UpdDriverFormat df)

Function Set format data of structure.


string printer Specify the name of printer.
UpdDriverFormat df Format information is set.

Return true Succeeded


false Failed

Remark Refer the chapter “About define” as for the details of df member.

-8-
7. Macro setting function
This function controls the macro setting into the property with SaneiUtilityPrinterDriver.
Component of macro data is described as follows:

n Macro function
Parameter (16 bits) Macro function (16 bits)
0 - Feed
1 - Back feed
2 - Full cut
3 - Partial cut
4 - Mark detection
5 - Mark redetection
6 - Illumination pattern of LED Bezel
7 - Logo printing

Macro function ‘n’ range Function


0 - Feed 0 to 255 Feed n dots length.
1 - Back feed 0 to 255 Back feed n dots length.
2 - Full cut 0 Execute full cut
3 - Partial cut 0 Execute partial cut
4 - Mark detection 0 Detect mark in next page.
5 - Mark redetection 0 Redetect mark in temporary page.
6 - Pattern of LED Bezel 0 to 3 Set illumination pattern of LED.
7 - Logo Printing 1 to 8 Print registered image pattern as a logo.

bool GetMacroData(string printer,int type,ref int num,ref int[] data)

Function Get macro data


string printer Specify the name of printer.
int type Input an event to execute macro.
0 – Start document
1 – Finish document
2 – Start job
3 – Finish job
int num Size of macro data is set.
int[] data Macro data is set.

Return true Succeeded


false Failed

-9-
bool SetMacroData(string printer,int type,int num,int[] data)
Function Set macro data
string printer Specify the name of printer.
int type Input an event to execute macro.
0 – Start document
1 – Finish document
2 – Start job
3 – Finish job
int num Size of macro data is set.
int[] data Macro data is set.

Return true Succeeded


false Failed

- 10 -
8. About define
Description of define class stored in Class library is mentioned as follows.

Printer status
Name Meanings
UPD_STATUS_NORMAL normal
UPD_STATUS_DOOR_OPEN Cover open
UPD_STATUS_PAPER_END No paper
UPD_STATUS_NEAR_END Nearly-end paper
UPD_STATUS_PAPER_FULL Paper remains bezel or pressenter
UPD_STATUS_OTHER_ERR Others (Temperature, Cutter, voltage error, etc)
UPD_STATUS_PAPER_JAM Paper course out

Enabling or Disabling function


Name Meanings
UPD_DISABLE Disable function
UPD_ENABLE Enable function

Paper width
Name Meanings
UPD_PAPER_58 Paper width: 58mm
UPD_PAPER_60 Paper width: 60mm
UPD_PAPER_80 Paper width: 80mm
UPD_PAPER_83 Paper width: 83mm
UPD_PAPER_112 Paper width: 112mm

Printing density
Name Meanings
UPD_DENSITY_60 Density: 60%
UPD_DENSITY_80 Density: 80%
UPD_DENSITY_100 Density: 100%
UPD_DENSITY_120 Density: 120%
UPD_DENSITY_140 Density: 140%
UPD_DENSITY_160 Density: 160%

Macro definition
Name Meanings
MACRO_MAX Maximum number of registering macro
UPD_MACRO_FEED Macro to feed
UPD_MACRO_BACKFEED Macro to back feed
UPD_MACRO_FULLCUT Macro to full cut
UPD_MACRO_PARTIALCUT Macro to partial cut
UPD_MACRO_DETECTION Macro to detect mark in next page
UPD_MACRO_REDETECTION Macro to redetect mark in temporary page
UPD_MACRO_LEDBEZEL Macro to set illumination pattern of LED bezel
UPD_MACRO_LOGOPRINT Macro to print registered image pattern as a logo.

- 11 -
9. Sample program
Sample programs are designed on Visual C#. Application is able to start through the build of project or
Clicking icon. Program is recalled API using api in Class Library.

Sample application 1: upd_api_test

(1)

(2)

(1) Select a printer adapted to SaneiUtilityPrinterDrivert through clicking Browse (1) button at first.

(2) Function

SDK Version: Display version by Exec button.

Raw Write: Send test print command by Exec button.

Status Get: Display status information by Exec button.

LM Enable: Enable printer status manager by Exec button.

LM Disable: Disable printer status manager by Exec button.

- 12 -
Sample application 2: upd_api_fmt_test

(1)

(2)

(1) Select a printer adapted to SaneiUtilityPrinterDrivert through clicking Browse (1) button at first.

(2) Function
Getting Format: Read and display temporary format by click.
Setting Format: Set format by clicking.

Initialize: Set enable or disable initialize.


PaperWidth: Set paper width. (0: 58mm, 1: 60mm, 2: 80mm 3: 83mm 4: 112mm)
Density: Set density. (0 to 5: 60 to 160%)
PaperSetting: Set paper length. (0: Flexible length, 1: Fixed length)
ReversePrint: Set reverse printing. (0: Disable, 1: Enable)
Compress: Set compressed communication. (0: Disable, 1: Enable)
WaterMark: Set water mark printing. (0: Disable, 1: Enable)
E-journal: Set electronic journal. (0: Disable, 1: Enable)
Autores: Set Auto status response command output.(0: Disable, 1: Enable)

- 13 -
LogoHeadPrint: Set function for printing logo at first.(0: Disable, 1-8: Registered image pattern)
Remote: Set function of remote control. (0: Disable, 1: Enable)
Mail: Set function of mail(0: Disable, 1: Enable)
Timeout: Set the time of “Time Out” for retract function of presenter.(0-61)
Mode: Set presenter operation mode.
(0:DEFAULT 1:CLAMP/RETRACT 2:CLAMP/EJECT
3:CLAMP ONLY 4:CONTINUOUS)

- 14 -
Sample application 3: upd_api_macro_test

(1)

(2)

(1) Select a printer adapted to SaneiUtilityPrinterDrivert through clicking Browse (1) button at first.

(2) Function

Target macro: Select a target document.


Macro Get: Read macro data.
Macro Set: Write macro data.

Macro No.: Macro number


Operation: Macro commands
Parameter: Parameter

Change: Change contents of macro number temporarily.


Addition: Add macro commands and parameters.
Delete: Delete macro number.

- 15 -

You might also like