br.com.gertec.gedi.interfacesInterface IPRNTR
public interface IPRNTR
Printer module interface.General printing function flow:
Init()
- Any DrawXXX functions:
DrawStringExt
,DrawPictureExt
,DrawBlankLine
,DrawBarCode
.Output()
Method Summary
Modifier and Type Method and Description void
DrawBarCode(br.com.gertec.gedi.structs.GEDI_PRNTR_st_BarCodeConfig config, java.lang.String data)
Draws a barcode to the print buffer.void
DrawBlankLine(int height)
Draws a blank line to the print buffer.void
DrawPictureExt(br.com.gertec.gedi.structs.GEDI_PRNTR_st_PictureConfig config, android.graphics.Bitmap bitmap)
Draws a picture on the printer buffer, using specified configuration.void
DrawStringExt(br.com.gertec.gedi.structs.GEDI_PRNTR_st_StringConfig config, java.lang.String text)
Draws a text on the printer buffer.int
GetPaperUsage()
Retrieves the accumulated paper usage since the last paper usage reset.void
Init()
Initializes the printer.void
Output()
Outputs the current printer buffer.void
ResetPaperUsage()
Sets the paper usage to 0 (zero).br.com.gertec.gedi.enums.GEDI_PRNTR_e_Status
Status()
Checks the Printer status.
Method Detail
Init
void Init() throws br.com.gertec.gedi.exceptions.GediExceptionInitializes the printer. Clear the contents of the printer buffer.
The printer buffer is where the printer drawing functions will take place.
This function will also clear anything previously drawn on the printer buffer.
- Throws:
br.com.gertec.gedi.exceptions.GediException
- See thedocumentation
for more information.
DrawStringExt
void DrawStringExt(br.com.gertec.gedi.structs.GEDI_PRNTR_st_StringConfig config, java.lang.String text) throws br.com.gertec.gedi.exceptions.GediExceptionDraws a text on the printer buffer.
- Parameters:
config
- Config object to customize the text to print (size, style, spacing, etc.).Ex.: GEDI_PRNTR_st_StringConfig config = new GEDI_PRNTR_st_StringConfig(new Paint()); config.paint.setTextSize(30); config.paint.setTextAlign(Paint.Align.LEFT); config.paint.setTypeface(Typeface.DEFAULT_BOLD); config.lineSpace = 10;text
- String to draw.- Throws:
br.com.gertec.gedi.exceptions.GediException
- See thedocumentation
for more information.
DrawPictureExt
void DrawPictureExt(br.com.gertec.gedi.structs.GEDI_PRNTR_st_PictureConfig config, android.graphics.Bitmap bitmap) throws br.com.gertec.gedi.exceptions.GediExceptionDraws a picture on the printer buffer, using specified configuration.
- Parameters:
config
- Config object to customize the bitmap to print. Use default values if null.bitmap
- Bitmap of the picture to print.- Throws:
br.com.gertec.gedi.exceptions.GediException
- See thedocumentation
for more information.
DrawBlankLine
void DrawBlankLine(int height) throws br.com.gertec.gedi.exceptions.GediExceptionDraws a blank line to the print buffer.
It is usually called to feed the paper after printing all contents.
- Parameters:
height
- Blank line height.- Throws:
br.com.gertec.gedi.exceptions.GediException
- See thedocumentation
for more information.
DrawBarCode
void DrawBarCode(br.com.gertec.gedi.structs.GEDI_PRNTR_st_BarCodeConfig config, java.lang.String data) throws br.com.gertec.gedi.exceptions.GediExceptionDraws a barcode to the print buffer.
- Parameters:
config
- Config object to customize the barcode to print. Depending on the barcode type, some values are ignored.
The type PDF_417 only consider the width value, ignoring the height value.data
- Content to print as barcode.- Throws:
br.com.gertec.gedi.exceptions.GediException
- See thedocumentation
for more information.
Output
void Output() throws br.com.gertec.gedi.exceptions.GediExceptionOutputs the current printer buffer.
- Throws:
br.com.gertec.gedi.exceptions.GediException
- See thedocumentation
for more information.
Status
br.com.gertec.gedi.enums.GEDI_PRNTR_e_Status Status() throws br.com.gertec.gedi.exceptions.GediExceptionChecks the Printer status.
- Returns:
- a bit mask containing the status of the printer.
- Throws:
br.com.gertec.gedi.exceptions.GediException
- See thedocumentation
for more information.
GetPaperUsage
int GetPaperUsage() throws br.com.gertec.gedi.exceptions.GediExceptionRetrieves the accumulated paper usage since the last paper usage reset. G800 no available.
- Returns:
- the paper usage.
- Throws:
br.com.gertec.gedi.exceptions.GediException
- See thedocumentation
for more information.
ResetPaperUsage
void ResetPaperUsage() throws br.com.gertec.gedi.exceptions.GediExceptionSets the paper usage to 0 (zero). G800 no available.
- Throws:
br.com.gertec.gedi.exceptions.GediException
- See thedocumentation
for more information.