Link to home
Start Free TrialLog in
Avatar of sureshbvs
sureshbvs

asked on

How to set Custom MediaSizeName?

Hi Experts,
  I liked to know how to set a custome MediaSizeName, for taking the print of a bill.  Now I am using  MediaSizeName.ISO_A4, instead of that the paper I am going to use is of size 100mm x 150mm size.  

Now I am using :

DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
pras.add(OrientationRequested.PORTRAIT);
pras.add(MediaSizeName.ISO_A4);
pras.add(new Copies(1));
pras.add(new JobName("My job", null));
PrintService printServices[] = PrintServiceLookup.lookupPrintServices(flavor, pras);

Regards
Suresh
ASKER CERTIFIED SOLUTION
Avatar of tapasvi
tapasvi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tapasvi
tapasvi

Pls. Accept the Answer posted by tapasvi. ;-)
taps

Pls. Accept the Answer posted by tapasvi. ;-)
taps