Java Printing to specific page size using label printer

后端 未结 3 895
猫巷女王i
猫巷女王i 2021-02-06 18:29

I am trying to use a label printer (EPSON TM-T88V to be specific), to spit out PNG images.

I can get it to print fine, except when I am printing an image dimensions (220

3条回答
  •  闹比i
    闹比i (楼主)
    2021-02-06 19:00

    This is the settings I use for printing on A4 paper with 10mm margin.

    int width = Math.round(MediaSize.ISO.A4.getX(MediaSize.MM));
    int height = Math.round(MediaSize.ISO.A4.getY(MediaSize.MM));
    das.add(new MediaPrintableArea(10, 10, width-20, height-20, MediaPrintableArea.MM));
    

提交回复
热议问题