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

Introduction of Print API

This document describes the print API file for Cilico Microelectronics Co., Ltd. It introduces the PrintHelper tool class which provides printing functions. It then details 10 methods for initializing printing, printing text, bitmaps, and controlling print alignment and style. The methods allow printing single lines of text or longer texts that automatically line break.

Uploaded by

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

Introduction of Print API

This document describes the print API file for Cilico Microelectronics Co., Ltd. It introduces the PrintHelper tool class which provides printing functions. It then details 10 methods for initializing printing, printing text, bitmaps, and controlling print alignment and style. The methods allow printing single lines of text or longer texts that automatically line break.

Uploaded by

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

Internal Public▲ (Permanent)

Print API File

API File Name:Print API File

API File No.:

Version :V1.1

Total 7 pages
(Including cover)

Compose
Review
Countersign

Add.4th Floor, HuixinIBC Building A, Zhangba 1st Road, Hi-tech Zone, Xi'an City, China.
1
Internal Public▲ (Permanent)

Cilico Microelectronics Co., Ltd

Modifiy record

Composed

By / Compose / Modify Major changes


File No. Version (Write main Review By
Modified Modify Date Reason
Points)
By

ShiLiangY
V1.0 ZhangYong 2017.03.27 None None
i

V1.1 Dongqiwu 2019.12.20 Android7.1 None

Note: When the file is prepared for the first time, write “None” on

"Modify Reason" and "Major modifications columns.

Add.4th Floor, HuixinIBC Building A, Zhangba 1st Road, Hi-tech Zone, Xi'an City, China.
2
Internal Public▲ (Permanent)

Contents

1 Description ...................................................................................................................................................... 4

2 Tool class introduce.......................................................................................................................................... 4

3 Method details Introduce................................................................................................................................. 5

3.1 PrintLineInit................................................................................................................................................... 4

3.2 PrintLineString...............................................................................................................................................4

3.3 PrintLineStringByType....................................................................................................................................5

3.4 PrintLineEnd...................................................................................................................................................5

3.5 PrintStringEx..................................................................................................................................................5

3.6 GetOneString.................................................................................................................................................6

3.7 PrintOneString............................................................................................................................................... 6

3.8 PrintBitmap....................................................................................................................................................6

3.9 PrintBitmapAtCenter......................................................................................................................................7

3.10 doHardwarePrint.........................................................................................................................................7

Add.4th Floor, HuixinIBC Building A, Zhangba 1st Road, Hi-tech Zone, Xi'an City, China.
3
Internal Public▲ (Permanent)

1 Description

This document detailed describes all the API which use for print.

2 Tool class introduce

The tool class is PrintHelper.java. Provides the open and close print service, print pictures, print text,

jump to the next page label function,and set the print grayscale interface.

3 Method details Introduce

3.1 PrintLineInit

Function public void PrintLineInit(int lineMaxSize)


prototype
Functional Invoke the method before Print single line text , the arg is the maximum font size of
description this line of text.
Parameter Param 1:the maximum font size of this line text;
description
Returned Value void

3.2 PrintLineString

Function public void PrintLineString(String str, int textSize, int nLeft,boolean bBold)
prototype
Functional According to the parameter description,draw a single line of text .
description
Parameter Param1 1: text content
Param1 2:text font size
Add.4th Floor, HuixinIBC Building A, Zhangba 1st Road, Hi-tech Zone, Xi'an City, China.
4
Internal Public▲ (Permanent)

description Param1 3:the distance to left edge


Param1 4:text style
Returned Value void

3.3 PrintLineStringByType

Function public void PrintLineStringByType(String str, int textSize,


prototype printer.PrintType type,boolean bBold)
Functional According to the parameter description,draw a single line of text .
description
Parameter Param1 1: text content
description Param1 2:text font size
Param1 3:horizontal alignment
Param1 4:text style
Returned Value void

3.4 PrintLineEnd

Function public void PrintLineEnd()


prototype
Functional Print the drawn single line text.
description
Parameter
description
Returned void
Value

3.5 PrintStringEx

Function public void PrintStringEx(String str, int textSize, boolean


prototype bUnderline,boolean bBold,printer.PrintType type)
Functional According to the parameter description,then print a long length text. if the
description text length beyond a line length, so it will auto Line feed
Parameter Param1 1: text content
description Param1 2:text font size
Param1 3:underline
Param1 4:text style
Param1 5:horizontal alignment
Returned void
Value

Add.4th Floor, HuixinIBC Building A, Zhangba 1st Road, Hi-tech Zone, Xi'an City, China.
5
Internal Public▲ (Permanent)

3.6 GetOneString

Function Boolean GetOneString(Paint pat, String str, int[] index, int nH)
prototype
Functional From the long text, get the start and end indexes in each line which will be
description print.
Parameter Param 1:Paint
description Param 2:text content
Param 3:the start and end indexes array
Param 4:text font size
Returned True or False
Value

3.7 PrintOneString

Function void PrintOneString(Canvas can, Paint paint, String str, int


prototype textHeight, Bitmap bmp,printer.PrintType type)
Functional According to the parameter description,then print a line of text of the long
description length text
Parameter Param 1:AppId
Param2:FileId
description
Returned void
Value

3.8 PrintBitmap

Function public void PrintBitmap(final Bitmap bm)


prototype
Functional Print Bitmap in a horizontal direction
description
Parameter Param 1:Bitmap
description
Returned void
Value

3.9 PrintBitmapAtCenter

Function public void PrintBitmapAtCenter(Bitmap bm,int labelHeight)


prototype
Functional Print Bitmap in the horizontal and vertical
Add.4th Floor, HuixinIBC Building A, Zhangba 1st Road, Hi-tech Zone, Xi'an City, China.
6
Internal Public▲ (Permanent)

description directions
Parameter Param 1:Bitmap
Param 2:the height of a single lable
description
Returned void
Value

3.10 doHardwarePrint

Function public void doHardwarePrint(Bitmap bm)


prototype
Functional Print a bitmap directly
description
Parameter Param 1:Bitmap
description
Returned void
Value

Add.4th Floor, HuixinIBC Building A, Zhangba 1st Road, Hi-tech Zone, Xi'an City, China.
7

You might also like