import com.landicorp.android.eptapi.device.Printer;
import com.landicorp.android.eptapi.exception.RequestException;
public class Print {
/**
- 实例化Printer的内部抽象类并重写其抽象方法,然后调用其start方法执行
-
*/
public static void printContent(){
Printer.Progress progress = new Printer.Progress() {
@Override
public void doPrint(Printer printer) throws Exception {
printer.println("--------------------------------");
printer.feedLine(8);
}
@Override
public void onCrash() {} @Override public void onFinish(int code) { } try { progress.start(); } catch (RequestException e) { // TODO 自动生成的 catch 块 e.printStackTrace(); }
}
}
0 个回复