Jasper reports Media problem

Hello experts,

I currently have Java application which uses Jasper Reports for printing invoices. I am now moving to a different invoice paper size (currently US Letter, moving to HalfLetter which is 8.5 x 5.5). I have defined the size in Windows Print Server->Forms correctly and can print to that media type from acrobat pdf (generated from iReport) but in the Java application the same (it looks the same anyway) printer dialogue does not offer that Media size as an option.

I don't think that this is a Jasper issue but rather a Java printing issue.

Does anyone know how to get windows defined paper sizes into the Java print service dialogue?

Please help soon as I am under the gun on this one.

Thanks in advance.

Who is Participating?
objectsConnect With a Mentor Commented:
If you want to use a set paper size, then why are you giving the user option?
Why not instead set the paper size in your application

gdrnecAuthor Commented:
Thanks for the reply. I have no problems enforcing a paper size on the user. However, I can't figure out how to do this. The link you posted covers the java.awt.print classes whereas I seem to have to use the javax.print classes because of Jasper. I can't see how these two meet up.

I can see how the paper size is set in the awt version using the Paper.setSize(d, d) method and using that in conjunction with the PrinterJob class but can you explain how to cross the two frameworks?

Am I making any sense?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.