views:

199

answers:

0

Hi, I need to use a card printer (Evolis Tattoo) with java .. the problem is, that java seems not to have a correct mediasize (54mm by 85mm or 2.13" by 3.38"). Thats my code:

  DocPrintJob job = tattoo.createPrintJob();

  PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
  aset.add(new MediaPrintableArea(0, 0, 54, 85, MediaPrintableArea.MM));
  aset.add(new PrinterResolution(300,300,PrinterResolution.DPI));


  MediaSizeName mediaSizeName = MediaSize.findMedia(54,85,MediaPrintableArea.MM);
  aset.add(mediaSizeName);

  Doc myDoc = new SimpleDoc(new CardPrintable(c), myFlavor,attrs);


  try {
 job.print(myDoc, aset);
  } catch (PrintException e) {
 e.printStackTrace();
  }

Is there a way to specify a custom size? Thanks in Advance!!!!!