I presume your code is intended to locate the services that support
duplex.
However what if that printer is not the system default?

Your code makes no connection between the services returned
by PrintServiceLookup.lookupPrintServices(..) and the Printer
Job you create with :

 PrinterJob printerjob = PrinterJob.getPrinterJob();

which will return a job on the default system printer.

you would need to then call - for example -
printerJob.setPrintService(services[0])

or call

PrintService services = printerJob.getPrintService()

and query whether it supports duplex, to make sure you'd
selected a suitable printer.

If all of that reveals that it DOES support duplex, then
upgrade to the latest printer driver version.

If still no luck we would want to know the
1) O/S
2) printer make and model
3) printer driver version
4) And have a complete standalone program that shows your problem
so we can try to look into it.

Caveat: it may be tricky to do much with this problem unless
we had the actual printer and duplexer as it sounds like one
of those problems you can only see with the physical device ..

-phil.


>Delivered-To: [EMAIL PROTECTED]
>MIME-Version: 1.0
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
>Date: Wed, 21 Aug 2002 14:59:06 +0200
>From: David Ortega del Campo <[EMAIL PROTECTED]>
>Subject: [JAVA2D] problems when printing with the duplex option
>To: [EMAIL PROTECTED]
>
>Hi
>Currently we are printing documents from Java, but we have problems when
>printing images with the duplex option. We set DUPLEX option when printing,
>but the printer don't print boths sides of the pages (Our printer suports boths
sides mode). Our code is similar
>to:
>
>    PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
>    aset.add(Sides.DUPLEX);
>    DocFlavor psInFormat = DocFlavor.SERVICE_FORMATTED.PRINTABLE;
>    PrintService[] services =
>PrintServiceLookup.lookupPrintServices(psInFormat, aset);
>    if (services.length > 0)
>    {
>      try{
>        PrinterJob printerjob = PrinterJob.getPrinterJob();
>        ...
>
>Thanks for any insights.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to