String message2 = "Rincian tagihan dapat diakses di Informasi Hubungi Call Center: " String message = "PLN menyatakan struk ini sebagai bukti pembayaran yang sah." + "\n" String jpaRef = "XXXX-XXXX-XXXX-XXXX" + "\n" StringBuilder content2Sb = new StringBuilder() Ĭontent2Sb.append("ADM BANK : Rp. String titleStr = "STRUK PEMBAYARAN TAGIHAN LISTRIK" + "\n\n"
Aplikasi cetak struk android how to#
See for more information on how to print image and P25 development guide page 18-13 and 63. Height= 45 pixels in decimal = 0x2D in hexa Width = 200pixels/8bit = 25 in decimals = 0x24 in hexa See P25 development guide page 60-63 for more information.īyte formats = Also call the PocketPos.FramePack(byte typeFrame, byte srcBuff, int srcOffset, int srcLen)to create frame data before sending to printer. For font types and text alignment, see FontDefine.java and for language definition, see PocketPos.java.
![aplikasi cetak struk android aplikasi cetak struk android](https://i.ytimg.com/vi/xkDWrdprg6g/maxresdefault.jpg)
Use Printer.printFont(String content, byte fonttype, byte fontalign,byte linespace, byte language)method to format and position the text. The source code is available on Github repo, you can find it at the bottom of this post.īyte line = Printer.printfont(text + "\n\n", FontDefine.FONT_32PX, FontDefine.Align_CENTER, (byte) 0x1A, PocketPos.LANGUAGE_ENGLISH) īyte senddata = PocketPos.FramePack(PocketPos.FRAME_TOF_PRINT, line, 0, line.length)
![aplikasi cetak struk android aplikasi cetak struk android](https://i0.wp.com/gobiz.co.id/images/perangkat/cetak-struk-instan.png)
This sample code shows how to print text, image, barcode and receipt into P25 printer using Bluetooth connectivity. The source code itself is quite old so i made a slight modification with fresh UI and easy to read source code so developers can easily implement the codes into their projects. It also has a good connectivity with Android device, makes printing from Android becomes very easy and fast.īlue Bamboo also provides a sample Android project to show how to build an application that supports printing using P25 printer over Bluetooth.
Aplikasi cetak struk android serial#
It supports mobile application printing over Bluetooth, USB or Serial port (RS-232). Blue Bamboo P25 printer is a lightweight and portable thermal printer that provides low cost printing in mobile and wireless environments.