IllegalArgumentException in getPrintJob
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Craig_Malton
Posted On:   Friday, May 3, 2002 10:29 AM

Hello I'm trying to use the java.awt.print class to print some text from an servlet to a remote printer. Both the servlet and printer run on windows. I'm running into an IllegalArgumentException: Invalid Value for Property Printer when I run getPrintJob() The following code sample doesn't work for me (I'm not at my desk right now so I'm typing this from memory, excuse any syntax errors. JobAttributes jobAttr = new JobAttributes(); String printerPath = "\\" + "CTAP5APP1" + "\" + "HP"; jobAttr.setPrinter(printerPath); PrintJob pjob = Toolkit.getDefaultToolkit().getPrintJob(f, "Printer", jobAttr, null);    More>>

Hello


I'm trying to use the java.awt.print class to print some text from an servlet to a remote printer. Both the servlet and printer run on windows. I'm running into an IllegalArgumentException: Invalid Value for Property Printer when I run getPrintJob()


The following code sample doesn't work for me (I'm not at my desk right now so I'm typing this from memory, excuse any syntax errors.


			
JobAttributes jobAttr = new JobAttributes();
String printerPath = "\\" + "CTAP5APP1" + "\" + "HP";
jobAttr.setPrinter(printerPath);
PrintJob pjob = Toolkit.getDefaultToolkit().getPrintJob(f, "Printer", jobAttr, null);



Has anyone been able to get this to work before? I have seen some other posting where people are using this syntax and it seemed to work for them.


Thanks in advance


Craig

   <<Less
About | Sitemap | Contact