aset = new HashPrintRequestAttributeSet();
//aset.add(OrientationRequested.REVERSE_PORTRAIT);
aset.add(new Copies(1));
aset.add(new JobName("PrintCard", null));
printService = PrintServiceLookup.lookupDefaultPrintService(); 
}
public void printCard(String msg) throws PrinterException, IOException {
if(logoURL!=null){
logoImage = ImageIO.read(this.logoURL);
}
PrinterJob pj = PrinterJob.getPrinterJob();
PageFormat pf = pj.defaultPage();
pj.setPrintable(this);
pj.setPrintService(printService);
System.out.println("printCard Width="+pf.getWidth());
System.out.println("printCard Height="+pf.getHeight());
//pj.pageDialog(aset);
  // if (pj.printDialog(aset)) {
JBarcodeBean jbcb = new JBarcodeBean();
jbcb.setCodeType(new Code128());
jbcb.setShowText(true);
jbcb.setCode(msg);
barcodeImage = jbcb.getBufferedImage();
pj.print();
//}
} public int print(Graphics g, PageFormat pf, int pageIndex)
throws PrinterException {
Paper paper = new Paper();
paper.setSize(pagerWidth, pagerHeigth);
double x = 1;
double y = 1;
double width = pagerWidth - 2 * x;
double height = pagerHeigth - 2 * y;
paper.setImageableArea(x, y, width, height);
pf.setPaper(paper);问题是我怎么设置页面的大小他都没变化`````