User Manual
Back-Clip Print-Scan All in One Device
CanvasPrint class
1. Init CanvasPrint, Parameter is PrinterType. If use this method. The canvas was init
to max width. Such as T9, the width is 72mm.
init(PrinterType printerType)
2. Set font property. Parameter is a FontProperty type,
setFontProperty(FontProperty fp)
FontProperty is a collections of font property. User can call method of setFont()
to set detail property.
If don’t use this method, you also can use the following method:
setLineWidth(float w) set paint width.
setTextSize(int size) set text size.
setItalic(boolean italic) set whether italic.
setStrikeThruText(boolean strike) set whether strikethrough.
setUnderlineText(boolean underline) set whether under line.
setFakeBoldText(boolean fakeBold) set fake bold.
3. Draw text on the canvas. Parameters x and y is text coordinate
in the left bottom corner. Y must greater than 0.
drawText(String nStr)
drawText(float x, String nStr)
drawText(float x, float y, String nStr)
4. Draw a line. Parameters startX, startY is start coordinate; stopX,stopY is end
coordinate.
drawLine(float startX, float startY, float stopX, float stopY)
5. Draw a rectangle. Parameters are the distance of edge to the left and top.
drawRectangle(float left, float top, float right, float bottom)
6. Draw an ellipse. Parameters is coordinate of edge which a bounding rectangle of the
ellipse.
drawEllips(float left, float top, float right, float bottom)
7. Draw an Image. “image” is bitmap file of image.
drawImage(Bitmap image);
drawImage(float left, Bitmap image);
drawImage(float left, float top, Bitmap image);
8. Get the canvas image. Return a bitmap.
getCanvasImage();
9. Set text aligns right. Against the special language. Such as Arabic.
setTextAlignRight(boolean alignRight);
10. Set print new line if the text exceeds the valid width.
setTextExceedNewLine(boolean newLine);
11. Avoid a word was split to Independent letter. Default is space.
setUseSplit(boolean useSplit);
setUseSplitAndString(boolean useSplit, String splitStr);
18