0

I am trying to set the paper size to be landscape A5. I am printing from a java application, using the default PrinterJob procedure. I am also printing to cups-pdf. My problem is, no matter what I try, I cannot change the page format to A4 or A5 or whatever ... it is stuck to US Letter.

My question is: is this an OS problem? or related to java ????

When I call

PageFormat pf = job.pageDialog(pf)

The dialog even wouldn't show any other option but US Letter

Update: When I try to print from Command Line, using lp... I can print any size very easily... but I want to do that from within Java...

mlwn
  • 1,156
  • 1
  • 10
  • 25
  • You ,at need to take advantage of the [Print Services API](http://docs.oracle.com/javase/tutorial/2d/printing/services.html) – MadProgrammer Aug 31 '14 at 20:54
  • 1
    This [example](http://stackoverflow.com/questions/13558152/how-can-i-print-a-custom-paper-size-cheques-8-x-4/13558335#13558335) might provide some more info about setting the page size.. – MadProgrammer Aug 31 '14 at 20:57
  • Thanks @MadProgrammer .. I'll check the example, do some reading... then get back to you... – mlwn Aug 31 '14 at 21:02
  • @MadProgrammer ... Thank you so much.... you could make your comment as answer please.. that solved my problem.. – mlwn Aug 31 '14 at 21:33

0 Answers0