“PrinterException: Paper's imageable width is too small” I can see what's wrong, but how can I fix it?

后端 未结 2 1149
伪装坚强ぢ
伪装坚强ぢ 2020-12-22 10:12

I\'m getting this error when I try to print something for a specific label printer in my current college project:

java.awt.print.PrinterException: Paper\'s i         


        
相关标签:
2条回答
  • 2020-12-22 10:45

    I had the same problem with Dymo 420P.

    Try setting imageable area to the same size as paper and origin 0,0. Then after PrinterJob.printDialog(), call PrinterJob.validatePage() with your pageformat. It will return valid pageformat with proper imageable area.

    0 讨论(0)
  • 2020-12-22 10:49

    i solve it adding

        PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
    
        aset.add(OrientationRequested.PORTRAIT);
        aset.add(MediaSizeName.INVOICE);
    
    
            job.print( aset);
    
    0 讨论(0)
提交回复
热议问题