jQuery in Action, 3rd edition
The moose likes Other JSE/JEE APIs and the fly likes No. of copies for printing..Urgent..please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "No. of copies for printing..Urgent..please" Watch "No. of copies for printing..Urgent..please" New topic

No. of copies for printing..Urgent..please

eric mt

Joined: Feb 18, 2001
Posts: 4
I am using jdk1.2.2 for printing,which utilises java.awt.print package,PageFormat and PrinterJob classes with interface Printable.When i run my program in Windows it will take the
page-set-up of windows itself.But i am not able to get multiple copies when i change the values in the option provided with the PrintDialog that comes for the same.A part of my code is mentioned below...
here i am doing
PrinterJob pj = PrinterJob.getPrinterJob();
PageFormat pf = pj.pageDialog(pj.defaultPage());
and after
class PrintableClass implements Printable
BufferedImage bi;
public PrintableClass(BufferedImage bim,PageFormat pf) {
bi = bim;
public int print(Graphics g,PageFormat pf,int pageIndex) {
if(pageIndex != 0) return NO_SUCH_PAGE;
Graphics2D g2 = (Graphics2D)g;
please somebody can help.....
Thanks in advance...Eric
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
Java Printing API questions should really go to the "Other Java APIs" forum, so I've moved this message.

Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
I agree. Here's the link: http://aspose.com/file-tools
subject: No. of copies for printing..Urgent..please
It's not a secret anymore!