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

Print Development Instructions

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Print Development Instructions

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Print development instructions

Version Change person Date Change content


V1.0 T 2019-05-21
Catalogue
Print development instructions........................................................................1
Catalogue................................................................................................2
Document Overview........................................................................2
For people........................................................................................3
Document intention.........................................................................3
Development environment and tools...............................................3
Overall design........................................................................................4
Interface function.............................................................................4
1.1 Open pos.................................................................................4
1.2 Close Pos.................................................................................4
1.3 Open serial port.........................................................................4
1.4 Close serial port.........................................................................5
1.5 Init Pos....................................................................................5
1.6 Print character string...................................................................5
1.7 Print picture..............................................................................6
1.8 Print QR..................................................................................6
1.9 Set QR width size.......................................................................6
2.0 Set QR pixel size........................................................................7
2.1 Print and feedpaper N dot lines......................................................7
2.2 Print and feedpaper N line............................................................7
2.3 Set the space of line....................................................................8
2.4 Set align way........................................................................8
2.5 Set font enlargement............................................................8
2.6 Set highlight print.................................................................9
2.7 Enable black mark search.....................................................9
2.8 black mark Search..............................................................10
2.9 Print barcode (code128).........................................................10
3.0 Set barcode character position...........................................10
3.1 Set Paper Return Distance.....................................................11
Android development and configuration................................................12

Document Overview

Print module interface description


For people

Software developer
Software tester

Document intention

For software developers reference

Development environment and tools

Development platform: win7 Ultimate 64

Development tools:Android studio 3.1

Compiling environment:ndkr16B java 1.8


Overall design

Interface function

1.1 Open pos

Function interface public void OpenPrint()


Function Description Power on printer
Parameter Description No
Return value No

1.2 Close Pos

Function interface public void ClosePrint()


Function Description power off on Printer
Parameter Description No
Return value No

1.3 Open serial port

Function interface Public boolean openProt()


Function Description Open serial port
Parameter Description No
Return value true : Success
1.4 Close serial port

Function interface Public int closeProt()


Function Description Close serial port
Parameter Description No
Return value 0 : Success

1.5 Init Pos

Function interface public int PrintInit()


Function Description Initialize the printer
Parameter Description No
Return value 0 : Success

1.6 Print character string

Function interface public int PrintChars(String Data)


Function Description Print character string
Parameter Description Data : character string
Return value 0 : Success
Annotation The string in the buffer and the full line
will print automatically
1.7 Print picture

Function interface public int PrintBitmap(Bitmap img)


Function Description Print picture directly
Parameter Description img : The picture to be printed
Return value The command length
Annotation The image should not be larger than
384 pixels wide,When printing a large
picture, if there is a large number of
text QR code in front of the printing,
you need to wait a certain time to
print,Otherwise, the printer cache will
overflow。This interface is used for
sending one - line dot matrix printing
one - line dot matrix printing

1.8 Print QR

Function interface public int PrintQR(String Data)


Function Description Print QR
Parameter Description Data : QR string
Return value The command length

1.9 Set QR width size

Function interface public int PrintQRWidth(int n)


Function Description Set the size of QR
Parameter Description n : QR size
Return value The command length
Annotation 1≤n ≤16
2.0 Set QR pixel size

Function interface public int PrintQRPixel(int n)


Function Description Set QR pixels
Parameter Description n : QR pixel
Return value The command length
Annotation 1≤n ≤16

2.1 Print and feedpaper N dot lines

Function interface public int PrintDotLines(int dots)


Print the contents of the buffer and
Function Description feedpaper N dot line
Parameter Description dots : Print and feedpaper N dot line
Return value The command length

2.2 Print and feedpaper N line

Function interface public int PrintLines(int lines)


Print the contents of the buffer and
Function Description feedpaper lines line
Parameter Description lines : Print and feedpaper lines dots line
Return value The command length
2.3 Set the space of line

Function interface public int PrintSetDotLine(int lines)


Function Description Set the line spacing to lines dots line
Parameter Description lines : Set the line spacing to N dots line
Return value The command length

2.4 Set align way

public int PrintSetLayout(Printer_Params.ALIGN


Function interface align)

Function Description Set align way


align:
LEFT,// Left align
Parameter Description CENTER,//Center align
RIGHT//Right align
Return value The command length

2.5 Set font enlargement

public int
PrintFontMagnify(Printer_Params.TEXT_ENLARGE
Function interface enlarge
)
Function Description enlarge font
enlarge:
NORMAL(0x00), // Normal
character
HEIGHT_DOUBLE(0x01), //
Parameter Description double-height character
WIDTH_DOUBLE(0x10), // double
width character
HEIGHT_WIDTH_DOUBLE (0x11); //
Double high width character
Return value The command length
2.6 Set highlight print

Function interface public int PrintSetColor(int highlight)


Function Description Set highlight print
highlight:
Parameter Description 0:Non-highlight print
1:Allow highlight print
Return value The command length

2.7 Enable black mark search

Function interface public int OpenBlackSerch()


Function Description Enable black mark Serch
Parameter Description
Return value The command length
Annotation The default is off

2.8 black mark Search

Function interface public int PrintBlackSerch()


Function Description Black mark Search
Parameter Description No
Return value The command length
Annotation The search stops at the next black
mark
2.9 Print barcode (code128)

Function interface public int PrintCode128(String text)


Function Description Print code128 bar code
Parameter Description text : Data to generate the barcode
Return value The command length

3.0 Set barcode character position

public int
Function interface SetTextPosition(Printer_Params.BAR_TEXT_POS pos)

Function Description Set barcode character position


Parameter Description The command length
NONE,
TOP,
Return value BOTTOM,
TOP_BOTTOM

3.1 Set Paper Return Distance

Function interface public int setUnwindPaperLen(int len)


Function Description Set Paper Return Distance (Only in label mode
can actual effects be achieved)
Parameter Description len:Paper return distance, maximum 74
Return value The command length
Android development and configuration

1.1 will provide the sdk copied to the project


libs under

Using the operating()

1.1 PrintLinkDev Class Instance

PrintLinkDev mPrintLinkDev;
mPrintLinkDev = new PrintLinkDev(this);
mPrintLinkDev.OpenPrint(); // open Printer
mPrintLinkDev.openPort(); // open Printer
mPrintLinkDev.ClosePrint(); // close printer
mPrintLinkDev.closePort(); // close printer

For details, please refer to Demo

You might also like