|
About
PocketStudio Shared Library Reference
This reference provides all required information about PalmOS Shared
Library "DPSDKLib.prc"
including sample code for quick and easy implementation in the different
Integrated Development Enviroments (IDE) while developing your own palm
application with printing ability.
NOTE!!! THIS IS THE
DOCUMENTATION OF THE CODEWARRIOR AND FALCH.NET SHARED LIBRARY. USE IT
FOR REFERENCE FOR NOW - ALL FUNCTIONS ARE PRETTY EASY TO USE, AND THE
EXAMPLE SHOWS ENOUGH. I'M TOO LAZY TO WRITE ONE MORE DOCUMENTATION RIGHT
NOW... :))
Release history:
-
Release 19 - 25 October 2002 :
DPSDK_ReadCardTracksStart -
used to start reading tracks and return immediatly while continue
processing in the background. See the examples!
DPSDK_ReadPaymentCardStart
- used to start reading payment card and return immediatly while
continue processing in the background. See the examples!
DPSDK_ReadCardResult - checks
for data received from magnetic card. Also used to stop the reading
process and turns off the reader. See the examples!
-
Release 18 - 17 October 2002 :
DPSDK_SetReadCardCallBack -
used to set user-defined callback function to interrupt the card
reading process when some event occurs..
DPSDK_ReadPaymentCard - now has
smarter timeout management that automaticly adjust it to 10 sec (or
below) on firmware version 2.06 and below and allows up to 2 min on
firmware 2.07 and above. Also, on firmware 2.07 and above there are
callback function that can be used to interrupt card reading at any
time.
DPSDK_ReadCardTracks - now has
smarter timeout management that automaticly adjust it to 10 sec (or
below) on firmware version 2.06 and below and allows up to 2 min on
firmware 2.07 and above. Also, on firmware 2.07 and above there are
callback function that can be used to interrupt card reading at any
time.
DPSDK_PrintScreen - supports
1,2,4,8,16,24,32 bit screen colour depth with Brightness/Contrast
adjustments;
DPSDK_SetImageSettings - turns
on/off Brightness/Contrast and sets their values for
DPSDK_PrintScreen and DPSDK_ScreenCapture;
DPSDK_ScreenCapture - captures
some portion of the screen in 1,2,4,8,16,24,32 bit screen colour
depth and saves it into a buffer;
-

Functions
Summary:
Library Functions
|
Description |
Err
DPSDKLibOpen(
UInt16 refNum,
UInt32 * clientContextP
) |
Standard
library open
refNum - Library reference number returned by SysLibLoad()
or SysLibFind()
clientContextP - pointer to variable for returning client
context. |
Err
DPSDKLibClose(
UInt16 refNum,
UInt32 clientContext
) |
Closes the
library, frees client context and globals
refNum - Library reference number returned by SysLibLoad()
or SysLibFind()
clientContext - client context |
Err
DPSDKLib_OpenLibrary(
UInt16 *refNumP,
UInt32 * clientContextP
) |
This
inline function handles the messy task of finding or loading the
library and calling its open function and handles cleanup if the
library could not be opened.
refNumP - Pointer to UInt16 variable that will hold the new
library reference number to be used in later calls
clientContextP - pointer to variable for returning client
context. |
Err
DPSDKLib_CloseLibrary(
UInt16 refNum,
UInt32 clientContext
) |
This
inline function closes the shared library. This handles removal of
the library from the system if there are no applications that use
it.
refNum - Library reference number obtained from
DPSDKLib_OpenLibrary().
clientContext - client context (as returned by the open
call) |
|
Init/Done Functions
|
Description |
Boolean
DPSDK_InitPrinter(
UInt16 refNum
) |
Initializes printer and returns true if initialization passes
successfully |
void
DPSDK_DonePrinter(
UInt16 refNum
) |
Frees allocated chunks and the SerialLibrary |
|
Print Functions |
Description |
void
DPSDK_ScreenCapture(
UInt16
refNum,
int x,int y, int
w,int h,
int percents
UInt8* buffer
) |
Converts the Palm-Screen content
within the specified rectangle with uper left corner (x,y)
and lower-right corner (x+w,y+h) into
Blaxk&White(1bit), scales it in percents to the oginal size
(w,h) and saves the result in buffer.
Note: the buffer must be at least (x/8+1)*y
bytes! |
void
DPSDK_SetImageSettings(
UInt16
refNum,
Boolean BrightEnabled,
int Brightness
Boolean
ContrastEnabled,
int Contrast
) |
Sets the brightness/contrast values when processing image with
colour depth 8 and above for PrintScreen and ScreenCapture. The
brightness/contrast values are from [0..200], the default is 100. |
void
DPSDK_LineFeed(
UInt16 refNum
) |
Feeds paper one line.
|
Boolean
DPSDK_SelfTest(
UInt16 refNum,
Boolean longtest
) |
Prints Self-Diagnostic
Test.
If longtest = true, prints the long test.
If longtest = false, prints the short test. |
Boolean
DPSDK_PrintText(
UInt16 refNum,
char* text
) |
Prints text in the current font and style. |
Boolean
DPSDK_PrintTextWrapped(
UInt16 refNum,
char* text
) |
Prints text word-wrapped in the current font and style.
|
Boolean
DPSDK_PrintBarcode(
UInt16 refNum,
int type,
char* barcode
) |
Prints Barcode in a
specified format.
The valid values for type are [0..8],
the barcode argument is a string with digits and/or letters
according to barcode type. |
Boolean
DPSDK_PrintBarcodeN(
UInt16 refNum,
int type,
UInt8* barcode,
UInt8 N
) |
Prints Barcode in a
specified format.
The valid values for type are [0..8],
the barcode argument is a buffer with code-depending
control character. |
Boolean
DPSDK_PrintBuffer(
UInt16 refNum,
char* buf,
int size
) |
Sends Byte-array (buf)
directly to printer. The buffer format must be in EPSON ESC/POS
code standart. |
Boolean
DPSDK_PrintImage(
UInt16 refNum,
Word x,Word y,
Byte* image
) |
Prints a bitmap image
where:
x is the weight, y is the height, and
image is a byte-array with size at least [((x%8+1)*y]
bytes. |
Boolean
DPSDK_UploadLogo(
UInt16
refNum,
UInt16
cardId,
char
* name
) |
CardId - Card memory where the logo file is.
name - the logo name as it was given in LogoManager |
Boolean
DPSDK_PrintLogo(
UInt16 refNum,
Byte mode
) |
Prints a logo already
uploaded by FontManager.
The valid values for mode are :
0 - normal,
1 - Double wide mode,
2 - Double high mode,
3 - DW+DH |
Boolean
DPSDK_PrintScreen(
UInt16 refNum,
int x,int y, int
w,int h,
int percents
) |
Prints the Palm-Screen
content within the specified rectangle with uper left corner (x,y)
and lower-right corner (x+w,y+h), and scales
it in percents to the oginal size (w,h).
|
Boolean
DPSDK_PrintBitmapRes(
UInt16 refNum,
DmResID ResID
) |
Prints bitmap from
resource ID that goes with the application PRC. Bitmap resource
must be up to 8 bit colours. |
Boolean
DPSDK_PrintBitmapPtr(
UInt16 refNum,
BitmapPtr Bmp
) |
Prints bitmap from a
given pointer. Bitmap must be up to 8 bit colours. |
|
Style Functions |
Description |
void
DPSDK_SetAlign(
UInt16 refNum,
int align
) |
Sets text align
to:
0 - left,
1 - center,
2 - right |
void
DPSDK_SetAutoLineFeed(
UInt16 refNum,
Boolean LF
) |
Sets/Unsets paper
auto-feed:
0 - unset,
1 - set |
void
DPSDK_SetBold(
UInt16 refNum,
Boolean bold
) |
Sets/Unsets bold
text style to :
0 - normal,
1 - bold |
void
DPSDK_SetBarcodeScale(
UInt16 refNum,
int scale
) |
The valid scale
values are 2,3,4.
It represents a relative scale factor according to normal size
with factor 2. |
void
DPSDK_SetBarcodeHeight(
UInt16 refNum,
int height
) |
Sets barcode height.
height = [1..255] in printer dots ( 203 dpi) |
void
DPSDK_SetBarcodeText(
UInt16 refNum,
int text
) |
Sets the presence and
position of text for barcodes.
0 - no text,
1 - above,
2 - below,
3 - both above and below
|
void
DPSDK_SetBarcodeAlign(
UInt16 refNum,
int align
) |
Sets horizontal or
vertical barcode align.
|
Horizonral |
Vertical
|
0 - left |
4 - left |
1 - center |
5 - center |
2 - right |
6 - right |
|
void
DPSDK_SetIntensity(
UInt16 refNum,
unsigned int intensity
) |
The valid values for
intensity are from 0 to 5, and correspond to the following
densitities of print: 70%, 80%, 90%, 100%, 120%, 150%
respectively. |
void
DPSDK_SetFont(
UInt16 refNum,
int font
) |
Sets font size
:
0-big font,
1-small font |
void
DPSDK_SetUnderline(
UInt16 refNum,
Boolean underline
) |
Sets underline
style for text
false - normal
true - underlined text
|
void
DPSDK_Set90degree(
UInt16 refNum,
Boolean R
) |
Sets/Unsets Rotation style for text
false - normal,
true - rotate text on 90
degree |
void
DPSDK_SetReverse(
UInt16 refNum,
Boolean R
) |
Sets/unsets Reverse
style for text
false - normal,
true - reverse text
(mirrored) |
|
Card Functions |
Description |
Boolean
DPSDK_ReadCardTracksStart(
UInt16 refNum,
char * Track1,
char * Track2,
char * Track3,
UInt16 timeout
) |
Initiates magnetic
card reading process and returns immediately. The reading
continues in the background and every second ReadCardTick event is
posted in the current application's queue, on read failin or
timeout elapsed the ReadCardTracksFailed event is posted, on
success a ReadCardTracksSuccess event is posted and the
information is ready to use. If you set timeout value to 0
no background processing is initiated, in this case you must call
ReadCardResult multiply times until you get the result or use it
to cancel the reading! If there is a field that you do not want to
take from a card, send NULL. The Procedure waits up to timeout
seconds for response from the printer.
Note: since the
function works in the background the variables you send MUST be
global or they must live long enough until the reading is stopped!
Note: Do NOT
unload the library while reading in progress! This will result in
Fatal Exception! |
Boolean
DPSDK_ReadPaymentCardStart(
UInt16 refNum,
char * Name, UInt16
sizeN,
char * Number, UInt16
sizeD, UInt16* year,
UInt16* month,
UInt16 timeout
) |
Initiates credit or
debit cards reading process and returns immediately. The reading
continues in the background and every second ReadCardTick event is
posted in the current application's queue, on read failin or
timeout elapsed the ReadPaymentCardFailed event is posted, on
success a ReadPaymentCardSuccess event is posted and the
information is ready to use. If you set timeout value to 0
no background processing is initiated, in this case you must call
ReadCardResult multiply times until you get the result or use it
to cancel the reading! If there is a field that you do not want to
take from a card, send NULL. The Procedure waits up to timeout
seconds for response from the printer.
Note: since the
function works in the background the variables you send MUST be
global or they must live long enough until the reading is stopped!
Note: Do NOT
unload the library while reading in progress! This will result in
Fatal Exception! |
Boolean
DPSDK_ReadCardResult(
UInt16 refNum,
Boolean cancel
) |
Gets the result from
the reading initiated by
DPSDK_ReadCardTracksStart or
DPSDK_ReadPaymentCardStart. Returns true if the reading is
successful and the information is stored in the values you
specified before. If you set cancel to TRUE, the reading process
will end immediately and the reader will be turned off.
Note: Use this
function only when you set the timeout value of the corresponding
Start functions to 0. Otherwise use the event management. |
void
DPSDK_SetReadCardCallBack(
UInt16 refNum,
ReadCardCallBackType
ReadCardTracks,
ReadCardCallBackType
ReadCardPayment
) |
Sets the callbacks for DPSDK_ReadCardTracks and
DPSDK_ReadPaymentCard. Pass 0(NULL) to remove the specified
callback. If the callback function returns true - the process
continues, if false - the reading is stopped and the reader turned
off. |
Boolean
DPSDK_ReadCard(
UInt16 refNum, UInt8
select,
char * buf, UInt16 size,
UInt16 timeout
) |
Prepares Printer to read a card and waits for response for
timeout seconds. If the card had been read, buffer would be
filled with information from Card-track/s specified by select. |
Boolean
DPSDK_ReadPaymentCard(
UInt16 refNum,
char * Name, UInt16
sizeN,
char * Number, UInt16
sizeD, UInt16* year,
UInt16* month,
UInt16 timeout
) |
Reads credit or debit cards and returns information retrieved from
it. If there is a field that you do not want to take from a card,
send NULL. The Procedure waits up to timeout seconds for
response from the printer. |
Boolean
DPSDK_ReadCardTracks(
UInt16 refNum,
char * Track1,
char * Track2,
char * Track3,
UInt16 timeout
) |
Reads card's tracks in the given buffers with length atleast 100
bytes. If one of the parameters is NULL it means that the
information from that track has not to be taken. |
Boolean
DPSDK_ReadBarcode(
UInt16 refNum,
int timeout,
char *buf,
int size
) |
Read a barcode from the serial port on bitrate 9600 and expects a
terminatate char CR,LF,SP or NULL (0x0A,0x0D,0x20,0x00). |
|
Status Functions |
Description |
Text-Block Functions |
Description |
void
DPSDK_TextStart(
UInt16 refNum
) |
Starts a text block |
void
DPSDK_TextEnd(
UInt16 refNum
) |
Ends text blok |
void
DPSDK_TextOut(
UInt16 refNum,
char * text
) |
Prints string with current block style |
void
DPSDK_TextOutN(
UInt16 refNum,
char * text, int size
) |
Prints string with current block style and length |
void
DPSDK_TextCharSpace (
UInt16 refNum,
Byte Space
) |
Set a leading character pixels |
void
DPSDK_TextFont(
UInt16 refNum,
Byte big, Byte bold,
Byte doubleheight,
Byte doublewidth,
Byte underline
) |
Set font style |
void
DPSDK_TextUnderline (
UInt16 refNum,
Byte Underline
) |
Sets/Unsets Underline style 0-2 line thikness |
void
DPSDK_TextBold (
UInt16 refNum,
Byte Bold
) |
Sets/Unsets Bold style |
void
DPSDK_Text90degree (
UInt16 refNum,
Byte Degree
) |
Sets/Unsets 90 degree character rotation |
void
DPSDK_TextIntensity (
UInt16 refNum,
Byte Intesity
) |
Specify print Intensity |
void
DPSDK_TextAlign (
UInt16 refNum,
Byte Align
) |
Specify Align style |
void
DPSDK_Text180degree (
UInt16 refNum,
Byte Degree
) |
Sets/Unsets 180 degree character rotation |
|
Documentation:

|
|
DPSDKLIBOPEN |
|
|
Purpose |
Opens the library,
creates and initializes the globals. This function must be called
prior to any other library functions. If DPSDKLibOpen fails, do not
call any other library functions. If DPSDKLibOpen succeeds, call
DPSDKLibClose when you are done using the library to release critical
system resources. |
|
|
Prototype |
Err DPSDKLibOpen(UInt16
refNum, UInt32 *clientContextP) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad() or SysLibFind().
clientContextP - pointer to variable for returning client
context. The client context is used to maintain client-specific data
for multiple client support. The value returned here will be used as a
parameter for other library functions, which require a client context |
|
|
Result |
errNone
memErrNotEnoughSpace |
|
|
|
|
top |

|
|
DPSDKLIBCLOSE |
|
|
Purpose |
Closes the library, frees
client context and globals. |
|
|
Prototype |
Err DPSDKLibClose(UInt16
refNum, UInt32 clientContext) |
|
|
Parameters |
refNum
- Library reference number returned by SysLibLoad() or SysLibFind().
clientContext - client context |
|
|
Result |
errNone
DPSDKLibErrStillOpen |
|
|
|
|
top |

|
|
DPSDKLIB_OPENLIBRARY |
|
|
Purpose |
User-level call to open
the library. This inline function handles the messy task of finding or
loading the library and calling its open function and handles cleanup
if the library could not be opened. |
|
|
Prototype |
__inline Err
DPSDKLib_OpenLibrary
(UInt16 *refNumP, UInt32 * clientContextP) |
|
|
Parameters |
refNumP - Pointer
to UInt16 variable that will hold the new library reference number to
be used in later calls
clientContextP - pointer to variable for returning client
context. The client context is used to maintain client-specific data
for multiple client support. The value returned here will be used as a
parameter for other library functions, which require a client context. |
|
|
Result |
errNone
memErrNotEnoughSpace
sysErrLibNotFound
sysErrNoFreeRAM
sysErrNoFreeLibSlots |
|
|
|
Comments |
*clientContextP
will be set to client context on success, or zero on failure. |
|
|
|
top |

|
|
DPSDKLIB_CLOSELIBRARY |
|
|
Purpose |
User-level call to close
the shared library. This handles removal of the library from the
system if there are no applications using the library. |
|
|
Prototype |
__inline Err
DPSDKLib_CloseLibrary
(UInt16 refNum, UInt32 clientContext) |
|
|
Parameters |
refNum - Library
reference number obtained from DPSDKLib_OpenLibrary().
clientContext - client context (as returned by the open call) |
|
|
Result |
errNone
sysErrParamErr |
|
|
|
|
top |

|
|
DPSDK_INITPRINTER
|
|
|
Purpose |
Initializes the printer
library. |
|
|
Prototype |
Boolean
DPSDK_InitPrinter(UInt16 refNum) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad() |
|
|
Result |
True if success,
otherwise false |
|
|
|
Comments |
If there exists another
printing process that uses the Serial Library, this could cause false
result. |
|
|
|
top |

|
|
DPSDK_DONEPRINTER
|
|
|
Purpose |
Frees allocated chunks
and the SerialLibrary. |
|
|
Prototype |
void
DPSDK_DonePrinter(UInt16 refNum) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad() |
|
|
Result |
None |
|
|
See also |
DPSDK_InitPrinter |
|
|
|
top |

|
|
DPSDK_SETREADCARDCALLBACK |
|
|
Purpose |
Sets user-defined
callback to alter card reading at any time. |
|
|
Prototype |
void
DPSDK_SetReadCardCallBack(UInt16 refNum,
ReadCardCallBackType ReadCardTracks,
ReadCardCallBackType ReadCardPayment) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
ReadCardTracks - the address of a callback function
to be called when DPSDK_ReadCardTracks is used. The callback is called
every second whitin the specified timeout. If the callback returns
false, the reading is stopped and the reader turned off.
ReadCardPayment - the address of a callback function
to be called when DPSDK_ReadPaymentCard is used. The callback is
called every second whitin the specified timeout. If the callback
returns false, the reading is stopped and the reader turned off.
|
|
|
Result |
None |
|
|
See also |
Example |
|
|
|
top |

|
|
DPSDK_SCREENCAPTURE |
|
|
Purpose |
Captures the screen and
stores in buffer |
|
|
Prototype |
Boolean
DPSDK_ScreenCapture(UInt16 refNum,int x,int
y, int w,int h, int
percents, UInt8 *buffer) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
(x,y,x+w,y+h) - rectangle within the screen
percents - scale factor
buffer - memory buffer for holding the result image.
Note: the buffer must be at least (x/8+1)*y
bytes! |
|
|
Result |
True if success,
otherwise false |
|
|
See also |
DPSDK_PrintImage |
|
|
|
top |

|
|
DPSDK_SETIMAGESETTINGS |
|
|
Purpose |
Sets the
brightness/contrast values for screen depth 8 bit and above |
|
|
Prototype |
void
DPSDK_SetImageSettings(UInt16 refNum, Boolean
BrightEnabled, int Brightness, Boolean
ContrastEnabled, int Contrast) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
BrightEnabled – Enable Brightness processing
Brightness – Brightness value [0..200], default is
100
ContrastEnabled – Enable contrast processing
Contrast – Contrast vaulue [0..200], default
is 100 |
|
|
Result |
None |
|
|
See also |
DPSDK_PrintScreen |
|
|
|
top |

|
|
DPSDK_LINEFEED
|
|
|
Purpose |
Feeds the paper one line.
|
|
|
Prototype |
void
DPSDK_LineFeed(UInt16 refNum) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad() |
|
|
Result |
None |
|
|
See also |
DPSDK_SetAutoLineFeed
|
|
|
|
top |

|
|
DPSDK_SELFTEST
|
|
|
Purpose |
Prints the Printer Self
Test |
|
|
Prototype |
Boolean
DPSDK_SelfTest(UInt16 refNum,Boolean longtest) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
longtest – if True, prints the Long Printer Test, otherwise
prints the Short Printer Test |
|
|
Result |
True if success,
otherwise false |
|
|
|
top |



|
|
DPSDK_PRINTBARCODE
|
|
|
Purpose |
Prints Barcode in the
current style. |
|
|
Prototype |
Boolean
DPSDK_PrintBarcode
(UInt16 refNum,int type, char* barcode) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
type – one of the following barcode types :
type
|
barcode
|
length
|
Data range
|
0
|
UPC-A |
11
|
[48..57]
|
1
|
UPC-E |
11
|
[48..57]
|
2
|
EAN13 (JAN13) |
12
|
[48..57]
|
3
|
EAN 8 (JAN8) |
7
|
[48..57]
|
4
|
CODE 39 |
-
|
[32, 36, 37, 43, 45..57, 65..90]
|
5
|
ITF |
-
|
[48..57]
|
6
|
CODABAR (NW-7) |
-
|
[36, 43, 45..58, 65..68]
|
7
|
CODE 93 |
-
|
[0..127]
|
8
|
CODE 128 |
-
|
[0..127]
|
|
|
|
Result |
True if success,
otherwise false |
|
|
Comments |
The function does not
check the correct format of every type. Thus, it returns true even if
the format is obviously wrong. |
|
|
See also |
DPSDK_SetBarcodeText
DPSDK_SetBarcodeScale
DPSDK_SetBarcodeHeight
DPSDK_SetAutoLineFeed
DPSDK_SetBarcodeAlign
DPSDK_SetIntensity
DPSDK_PrintBarcodeN |
|
|
|
top |

|
|
DPSDK_PRINTBARCODEN |
|
|
Purpose |
Prints Barcode in the
current style. |
|
|
Prototype |
Boolean
DPSDK_PrintBarcodeN
(UInt16 refNum,int type, UInt8* barcode,
UInt8 N) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
type – one of the following barcode types :
type
|
barcode
|
length
|
Data range
|
0
|
UPC-A |
11
|
[48..57]
|
1
|
UPC-E |
11
|
[48..57]
|
2
|
EAN13 (JAN13) |
12
|
[48..57]
|
3
|
EAN 8 (JAN8) |
7
|
[48..57]
|
4
|
CODE 39 |
-
|
[32, 36, 37, 43, 45..57, 65..90]
|
5
|
ITF |
-
|
[48..57]
|
6
|
CODABAR (NW-7) |
-
|
[36, 43, 45..58, 65..68]
|
7
|
CODE 93 |
-
|
[0..127]
|
8
|
CODE 128 |
-
|
[0..127]
|
|
|
|
Result |
True if success,
otherwise false |
|
|
Comments |
[Caution]
When data being held in the print buffer, this command is ignored.
Regardless of the specified feed pitch, this command feeds the paper
that is required to print a bar code.
If the character code d cannot be printed in the respective bar code
system, the bar code so far will be printed, processing the subsequent
data as normal data.
When a bar code whose number of characters to be printed is fixed has
been selected, the number of characters k have to be always made equal
to the number of characters to be printed. (The bar code is not
printed when not matching.)
When the horizontal direction exceeds one line length, the bar code is
not printed.
[CODE 128 additional information]
Code 128 covers all ASCII codes from 0 to 127, and it has three tables
A, B and C that can be used in the same bar code.
Table A: contains ASCII symbols with codes 0 to 95 and control symbols
FNC1, FNC2, FNC3, FNC4, SHIFT, CODEB, CODEC.
Table B: contains symbols with ASCII codes from 32 to 127 and control
characters FNC1, FNC2, FNC3, FNC4, SHIFT, CODEA, CODEC.
Table C: It is used for coding bar code areas that consist only of
numerals. Each symbol gives two digits that are coded with ASCII codes
from 0 to 99. Control characters FNC1, CODEA, CODEB are also
available.
The bar code must start with one of the symbols CODEA, CODEB or CODEC,
that determines which table will be used. If it is necessary the
current table could be changed later by inserting one of these symbols
in to the bar code. The symbol following SHIFT character is considered
to be from table B, if table A is current, or from table A, if table B
is current. If a symbol that is not valid for the current table is
used, the whole bar code is not printed.
Control symbols are assigned two bytes as follows:
symbol
|
Decimal
|
Hexadecimal
|
Text
|
FNC1
|
123, 49
|
7B, 31
|
{1
|
FNC2
|
123, 50
|
7B, 32
|
{2
|
FNC3
|
123, 51
|
7B, 33
|
{3
|
FNC4
|
123, 52
|
7B, 34
|
{4
|
CODEA
|
123, 65
|
7B, 41
|
{A
|
CODEB
|
123, 66
|
7B, 42
|
{B
|
CODEC
|
123, 67
|
7B, 43
|
{C
|
SHIFT
|
123, 83
|
7B, 53
|
{S
|
{
|
123, 123
|
7B, 7B
|
{{
|
The function does check if the printer version is greater than 2.0 and
return false otherwise. If the barcode content contradict with type
and control character the barcode is not printed.
|
|
|
See also |
DPSDK_SetBarcodeText
DPSDK_SetBarcodeScale
DPSDK_SetBarcodeHeight
DPSDK_SetAutoLineFeed
DPSDK_SetBarcodeAlign
DPSDK_SetIntensity
DPSDK_PrintBarcode |
|
|
|
top |

|
|
DPSDK_PRINTBUFFER
|
|
|
Purpose |
Sends a byte sequence
directly to the printer. |
|
|
Prototype |
Boolean
DPSDK_PrintBuffer(UInt16 refNum,char* buf, int size) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
buf – the buffer that should be sent
size – the size of the buffer |
|
|
Result |
True if success,
otherwise false |
|
|
Comments |
If the buffer is smaller
than the specified size, the function may cause bus error.
|
|
|
See also |
DPSDK_PrintLogo
DP_UploadLogo
DPSDK_PrintImage
DPSDK_PrintScreen
DPSDK_SetIntensity |
|
|
|
top |

|
|
DPSDK_PRINTIMAGE
|
|
|
Purpose |
Prints a bit-image.
|
|
|
Prototype |
Boolean DPSDK_PrintImage
(UInt16 refNum,Word x,Word y, Byte* image) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
x – weight of the image
y – height of the image
image – pointer to the buffer where the bit-image is stored
|
|
|
Result |
True if success,
otherwise false |
|
|
Comments |
If the buffer is smaller
than [((x/8+1)*y], the function may cause bus error. |
|
|
See also |
DPSDK_PrintLogo
DP_UploadLogo
DPSDK_SetIntensity
DPSDK_PrintScreen |
|
|
|
top |

|
|
DPSDK_UPLOADLOGO |
|
|
Purpose |
Upload Logo on printer
created by LogoManager |
|
|
Prototype |
Boolean DPSDK_UploadLogo
(UInt16 refNum, UInt16 cardId, Byte* name) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
cardId– card number where the logo PDB is.
name – name of the logo as it was set with LogoManager
|
|
|
Result |
True if success,
otherwise false |
|
|
See also |
DPSDK_PrintLogo
DPSDK_SetIntensity
DPSDK_PrintScreen |
|
|
|
top |

|
|
DPSDK_PRINTLOGO
|
|
|
Purpose |
Prints uploaded image.
|
|
|
Prototype |
Boolean
DPSDK_PrintLogo(UInt16 refNum,Byte m) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
m – mode
The valid values for mode are
|
M |
Mode Name
|
Dots in Vertical Direction
|
Dots in Horizontal Direction
|
0 |
Normal mode |
203 DPI
|
203 DPI
|
1 |
Double wide mode |
203 DPI
|
101 DPI
|
2 |
Double high mode |
101 DPI
|
203 DPI
|
3 |
DW / DH mode |
101 DPI
|
101 DPI
|
|
|
|
Result |
None |
|
|
See also |
DPSDK_SetIntensity
DPSDK_PrintImage
DPSDK_PrintScreen
DP_UploadLogo |
|
|
|
top |

|
|
DPSDK_PRINTSCREEN
|
|
|
Purpose |
Gets the screen content
within the rectangle with top-left corner (x,y) and bottom-right
corner(x+w,y+h) and scales it in percents before print. |
|
|
Prototype |
Boolean DPSDK_PrintScreen
(UInt16 refNum,int x,int y, int w,int
h, int percents) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
(x,y,x+w,y+h) - rectangle within the screen
percents - scale factor |
|
|
Result |
True if success,
otherwise false |
|
|
See also |
DPSDK_SetIntensity
DPSDK_PrintImage
DPSDK_PrintLogo
DP_UploadLogo |
|
|
|
top |

|
|
DPSDK_PRINTBITMAPRES |
|
|
Purpose |
Prints bitmap from
resource ID that goes with the application PRC. Bitmap resource must
be up to 8 bit colours. |
|
|
Prototype |
Boolean
DPSDK_PrintBitmapRes(UInt16 refNum, DmResID ResID) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
ResID - Resource Identifier from already opened Database
for access is used DmGetResource |
|
|
Result |
True if success,
otherwise false |
|
|
See also |
DPSDK_PrintBitmapPtr |
|
|
|
top |

|
|
DPSDK_PRINTBITMAPPTR |
|
|
Purpose |
Prints bitmap from a
given pointer. Bitmap must be up to 8 bit colours. |
|
|
Prototype |
Boolean
DPSDK_PrintBitmapPtr(UInt16 refNum, BitmapPtr Bmp) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
Bmp - Pointer to a standart PalmOS Bitmap (can be compressed ). |
|
|
Result |
True if success,
otherwise false |
|
|
See also |
DPSDK_PrintBitmapRes |
|
|
|
top |






|
|
DPSDK_SETBARCODETEXT
|
|
|
Purpose |
Sets the presence and
position of barcodes-text. This text is the string passed to
DPSDK_PrintBarcode. |
|
|
Prototype |
void
DPSDK_SetBarcodeText(UInt16 refNum,int text) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
text:
0 – no text,
1 – above,
2 – below,
3 – both above and below |
|
|
Result |
None |
|
|
See also: |
DPSDK_PrintBarcode
DPSDK_SetBarcodeScale
DPSDK_SetBarcodeHeight
DPSDK_SetBarcodeAlign
|
|
|
|
top |

|
|
DPSDK_SETBARCODEALIGN |
|
|
Purpose |
Sets the presence and
position of barcodes-text. This text is the string passed to
DPSDK_PrintBarcode. |
|
|
Prototype |
void
DPSDK_SetBarcodeAlign(UInt16 refNum, int align) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
align: one of next values
|
Horizonral |
Vertical
|
0 - left |
4 - left |
1 - center |
5 - center |
2 - right |
6 - right |
|
|
|
Result |
None |
|
|
See also: |
DPSDK_PrintBarcode
DPSDK_SetBarcodeScale
DPSDK_SetBarcodeHeight
DPSDK_SetBarcodeText |
|
|
|
top |

|
|
DPSDK_SETINTENSITY
|
|
|
Purpose |
Sets the darkness of the
print. |
|
|
Prototype |
void
DPSDK_SetIntensity(UInt16 refNum,unsigned int intensity) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
intensity – one of the following values:
0 – 70%
1 – 80%
2 – 90%
3 – 100%
4 – 120%
5 – 150% |
|
|
Result |
None |
|
|
See also: |
DPSDK_PrintBarcode
DPSDK_SetBarcodeScale
DPSDK_SetBarcodeHeight
|
|
|
|
top |





|
|
DPSDK_GETLASTERROR
|
|
|
Purpose |
Returns the last
SerialLibrary error. |
|
|
Prototype |
Err
DPSDK_GetLastError(UInt16 refNum) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad() |
|
|
Result |
The error code
|
|
|
Comments |
Codes are the same as the
SerialLibrary ones |
|
|
|
top |

|
|
DPSDK_GETBATTERY
|
|
|
Purpose |
Returns battery status in
percentage 0 - 100%. |
|
|
Prototype |
int
DPSDK_GetBattery(UInt16 refNum) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad() |
|
|
Result |
The battery status.
|
|
|
|
|
|
top |

|
|
DPSDK_GETTEMPERATURE
|
|
|
Purpose |
Returns the printer head
temperature. |
|
|
Prototype |
int
DPSDK_GetTemperature(UInt16 refNum) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad() |
|
|
Result |
The temperature
|
|
|
|
|
|
top |

|
|
DPSDK_GETRELEASE |
|
|
Purpose |
Returns the library
release number |
|
|
Prototype |
UInt16 DPSDK_GetRelease
(UInt16 refNum) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad() |
|
|
Result |
The Library release
number |
|
|
|
top |

|
|
DPSDK_GETPRINTERVERSION |
|
|
Purpose |
Returns the printer
firmware version in format :
HIBYTE - major version number
LOBYTE - minor version number
ex: 0x0200 - means v2.00 |
|
|
Prototype |
int
DPSDK_GetPrinterVersion(UInt16 refNum) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad() |
|
|
Result |
The printer firware
version |
|
|
|
top |

|
|
DPSDK_ISINITIALIZED |
|
|
Purpose |
Returns true if library
is initialized |
|
|
Prototype |
Boolean
DPSDK_IsInitialized(UInt16 refNum) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad() |
|
|
Result |
True if already
initialized |
|
|
|
top |

|
DPSDK_READCARDTRACKSSTART |
|
|
Purpose |
Initiates magnetic card reading process
and returns immediately. The reading continues in the background and
every second ReadCardTick event is posted in the current application's
queue, on read failin or timeout elapsed the ReadCardTracksFailed
event is posted, on success a ReadCardTracksSuccess event is posted
and the information is ready to use. If you set timeout value
to 0 no background processing is initiated, in this case you must call
ReadCardResult multiply times until you get the result or use it to
cancel the reading! If there is a field that you do not want to take
from a card, send NULL. The Procedure waits up to timeout
seconds for response from the printer. |
|
|
Prototype |
Boolean DPSDK_ReadCardTracks (UInt16
refNum,
char * Track1,char * Track2,char *
Track3,
UInt16 timeout) |
|
|
Parameters |
refNum -Library reference number
returned by SysLibLoad()
TrackX - Buffer to store track info - atleast 300 bytes
timeout - seconds to wait (Up to 2 min in firmware version 2.07
and above. The timeout is automaticly adjusted.) |
|
|
Result |
true if read succeeds, otherwise false. |
|
|
Comments |
Note: since the
function works in the background the variables you send MUST be global
or they must live long enough until the reading is stopped!
Note: Do NOT unload the
library while reading in progress! This will result in Fatal
Exception! |
|
|
See also: |
DPSDK_ReadPaymentCardStart
DPSDK_ReadCardResult
DPSDK_ReadPaymentCard Example |
|
|
|
top |

|
DPSDK_READPAYMENTCARDSTART |
|
|
Purpose |
Initiates credit or debit cards reading
process and returns immediately. The reading continues in the
background and every second ReadCardTick event is posted in the
current application's queue, on read failin or timeout elapsed the
ReadPaymentCardFailed event is posted, on success a
ReadPaymentCardSuccess event is posted and the information is ready to
use. If you set timeout value to 0 no background processing is
initiated, in this case you must call ReadCardResult multiply times
until you get the result or use it to cancel the reading! If there is
a field that you do not want to take from a card, send NULL. The
Procedure waits up to timeout seconds for response from the
printer. |
|
|
Prototype |
Boolean DPSDK_ReadPaymentCardStart(UInt16
refNum, char * Name,
UInt16 sizeN, char * Number, UInt16
sizeD,
UInt16* year, UInt16* month, UInt16 timeout) |
|
|
Parameters |
refNum -Library reference number
returned by SysLibLoad()
Name - Buffer to store name info
sizeN - size of buffer Name
Number - Buffer to store Card Number
sizeD - size of buffer Number
year - pinter to UInt16 for Card expiration year
nomth - pointer to UInt16 for Card expiration month
timeout - seconds to wait (Up to 2 min in firmware version 2.07
and above. The timeout is automaticly adjusted.) |
|
|
Result |
true if start succeeds, otherwise false. |
|
|
Comments |
Note: since the
function works in the background the variables you send MUST be global
or they must live long enough until the reading is stopped!
Note: Do NOT unload the
library while reading in progress! This will result in Fatal
Exception! |
|
|
See also: |
DPSDK_ReadCardTracksStart
DPSDK_ReadCardResult
DPSDK_ReadPaymentCard Example |
|
|
|
top |

|
DPSDK_READCARDRESULT |
|
|
Purpose |
Gets the result from the reading initiated
by DPSDK_ReadCardTracksStart or
DPSDK_ReadPaymentCardStart.
Returns true if the reading is successful and the information is
stored in the values you specified before. If you set cancel to TRUE,
the reading process will end immediately and the reader will be turned
off. |
|
|
Prototype |
Boolean DPSDK_ReadCardResult(UInt16
refNum, Boolean stop) |
|
|
Parameters |
refNum -Library reference number
returned by SysLibLoad()
stop - if TRUE stops reading |
|
|
Result |
true if read succeeds, otherwise false. |
|
|
Comments |
Note: Use this function
only when you set the timeout value of the corresponding Start
functions to 0. Otherwise use the event management. |
|
|
See also: |
DPSDK_ReadPaymentCardStart
DPSDK_ReadCardTracksStart
DPSDK_ReadCard Example |
|
|
|
top |

|
|
DPSDK_READCARD |
|
|
Purpose |
Prepares Printer to read
a card and wait for response up to timeout seconds. If the card
had been read, buffer would be filled with information from
Card-track/s specified by select. |
|
|
Prototype |
Boolean
DPSDK_ReadCard(UInt16 refNum, UInt8 select,
char * buf, UInt16 size, UInt16 timeout) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
select - specifies what to read from card and takes arithmetic
OR of the values :
ReadFrom1Track
ReadFrom2Track
ReadFrom3Track
ex: DPSDK_ReadCard( Ref,
ReadFrom1Track | ReadFrom2Track, buf, 200, 15);
buf - pointer for retrieved card info.
size - size of the passed buffer (buf)
timeout - seconds to wait ( 15 seconds recommended ) |
|
|
Result |
true if read succeeds,
otherwise false. |
|
|
See also: |
DPSDK_ReadPaymentCard
DPSDK_ReadCardTracks
DPSDK_ReadCard Example |
|
|
|
top |

|
|
DPSDK_READPAYMENTCARD |
|
|
Purpose |
Reads credit or debit
card and returns information retrieved from it. If there is a field
that you do not want to take from the card, send NULL. The Procedure
will wait up to timeout seconds. |
|
|
Prototype |
Boolean
DPSDK_ReadPaymentCard(UInt16 refNum, char * Name,
UInt16 sizeN, char * Number, UInt16
sizeD,
UInt16* year, UInt16* month, UInt16 timeout) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
Name - Buffer to store name info
sizeN - size of buffer Name
Number - Buffer to store Card Number
sizeD - size of buffer Number
year - pinter to UInt16 for Card expiration year
nomth - pointer to UInt16 for Card expiration month
timeout - seconds to wait (Up to 2 min in firmware version 2.07
and above. The timeout is automaticly adjusted.) |
|
|
Result |
true if read succeeds,
otherwise false. |
|
|
Comments |
If you do not want to
retrieve any part of the card information, just pass NULL. |
|
|
See also: |
DPSDK_ReadCard
DPSDK_ReadCardTracks
DPSDK_ReadPaymentCard Example |
|
|
|
top |

|
|
DPSDK_READCARDTRACKS |
|
|
Purpose |
Reads magnetic cards
returns information retrieved from it. If there is a field that you do
not want to take from the card, send NULL. The Procedure will wait up
to timeout seconds. |
|
|
Prototype |
Boolean
DPSDK_ReadCardTracks (UInt16 refNum,
char * Track1,char * Track2,char *
Track3,
UInt16 timeout) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
TrackX - Buffer to store track info - atleast 100 bytes
timeout - seconds to wait (Up to 2 min in firmware version 2.07
and above. The timeout is automaticly adjusted.) |
|
|
Result |
true if read succeeds,
otherwise false. |
|
|
Comments |
If you do not want to
retrieve any part of the card information, just pass NULL. |
|
|
See also: |
DPSDK_ReadCard
DPSDK_ReadPaymentCard
DPSDK_ReadPaymentCard Example |
|
|
|
top |

|
|
DPSDK_READBARCODE |
|
|
Purpose |
Reads a barcode from the
serial port on bitrate 9600 and expects a terminatate char CR,LF,SP or
NULL (0x0A,0x0D,0x20,0x00). The Procedure will wait up to timeout
seconds. |
|
|
Prototype |
Boolean DPSDK_ReadBarcode
(UInt16 refNum, int timeout, char *buf,
int size) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
timeout - seconds to wait ( 5-10 seconds recommended )
buf - Buffer to store barcode number
size - size of barcode buffer |
|
|
Result |
true if read succeeds,
otherwise false. |
|
|
|
top |






|
|
DPSDK_TEXTFONT |
|
|
Purpose |
Change text style |
|
|
Prototype |
void
DPSDK_TextFont(UInt16 refNum, Byte big, Byte bold,
Byte doubleheight, Byte doublewidth, Byte underline) |
|
|
Parameters |
refNum -Library
reference number returned by SysLibLoad()
Big : 0 - small font, 1 - big font
Bold : 0 - unset , 1- set
DoubleHeight : 0 - unset , 1- set
DoubleWidth : 0 - unset , 1- set
Underline : 0 - unset , 1- set |
|
|
Result |
None |
|
|
See also: |
DPSDK_TextStart
DPSDK_TextEnd
DPSDK_TextOut
DPSDK_TextOutN
DPSDK_TextCharSpace
DPSDK_TextUnderline
DPSDK_TextBold
DPSDK_Text90degree
DPSDK_TextIntensity
DPSDK_TextAlign
DPSDK_Text180degree |
|
|
|
top |







Implementation
This section describes how to implement printing functions for PP-50 in
your applications.
There are only two files required : "DPSDKLib.prc"
and "DPSDKLib.h".
Upload DPSDKLib.prc on your Palm device. Copy DPSDKLib.h into your project
source directory and add the following lines in the include section of
your program :
Here is an example code for Load, initialize and usage of PP-50
Example of DPSDK_ReadCard :
Example of DPSDK_ReadPaymentCard:
Example of
DPSDK_ReadPaymentCardStart:
Example forText-Block Functions use:
|