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

后端 未结 2 1176
伪装坚强ぢ
伪装坚强ぢ 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:49

    i solve it adding

        PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
    
        aset.add(OrientationRequested.PORTRAIT);
        aset.add(MediaSizeName.INVOICE);
    
    
            job.print( aset);
    

提交回复
热议问题