4

I have Pax A920 which runs with android . So how to using printing service in java?

Abanuob Fouad
  • 75
  • 3
  • 6

1 Answers1

1

I suggest you to use the Neptune api. you can google pax 920 neptune api demo and the fist link that shows up (https://docs.hips.com/docs/pax-a920) contains a demo that shows all the basic functions (including the printer) and you can run it on your device:

In the Application you first need a function to retrieve the IDAL:

public static IDAL getDal() {
    if(dal == null){ //dal is a private static IDAL variable of the application
        try {
            dal = NeptuneLiteUser.getInstance().getDal(context);
        } catch (Exception e) {}
    }
    return dal;
}

then in your activity you can just do the following:

try {
    IPrinter printer=   MyApp.getDal().getPrinter();
    printer.init();
    printer.printStr("Your text",null);
    printer.start();
} catch (PrinterDevException e) {
    e.printStackTrace();
}
IAmUser
  • 78
  • 5
  • Any idea how to use `void setFontPath(java.lang.String fontPath)` function? – Mohamed Medhat Nov 28 '21 at 11:37
  • @MohamedMedhat nope sorry, I had to change my font only slightly and I used `void fontSet(EFontTypeAscii asciiFontType,EFontTypeExtCode fontTypeExtCode)` Did you try giving it the path of a .ttf file? Still, I would be surprised if it worked with any type of font – IAmUser Nov 29 '21 at 12:28
  • tried a lot but no luck :( – Mohamed Medhat Dec 02 '21 at 07:32