This came up once before and my analysis at that time was that
the printer driver for these DataCard SPX5 printers is buggy.
http://bugs.sun.com/view_bug.do?bug_id=5095586
Read my complaints about the driver there.
Maybe there's an updated driver available?

-phil.

[EMAIL PROTECTED] wrote:
Hi,

We are working on implementing ID-Card printing solution for our customer using 
Datacard SP25 Plus and Java Printing.

We do have the following Problem:

The default and the only MediaSize for this printer is CR80 (2.13 x 3.88 
inches).

When printed from any program using Windows service (for e.g Wordpad), it shows 
the correct Media Size.

When trying to print via Java method, some arbitrary Media Size is shown. And 
it varies from PC to PC.

How to fix this problem? How to implement or create custom class for this 
MediaSize?

Here is the Java Testing Code.


import java.awt.GraphicsConfiguration;

import javax.print.DocFlavor;
import javax.print.PrintService;
import javax.print.PrintServiceLookup;
import javax.print.ServiceUI;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.MediaPrintableArea;
import javax.print.attribute.standard.MediaSize;

public class TestDatacardSP25 {

    public static void main(String[] args) {
        PrintService[] services = PrintServiceLookup.lookupPrintServices(null,
                null);

        PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
        //                              Media size
        aset.add(MediaSize
                .findMedia((float) 2.13, (float) 3.38, MediaSize.INCH));
        //Media printable area
        aset.add(new MediaPrintableArea(0, 0, (float) 2.13, (float) 3.38,
                MediaPrintableArea.INCH));

        PrintService service = PrintServiceLookup.lookupDefaultPrintService();
        DocFlavor flavor = DocFlavor.INPUT_STREAM.AUTOSENSE;
        //Show print Dialog
        service = ServiceUI.printDialog((GraphicsConfiguration) null, 60, 60,
                services, service, null, aset);
    }
}


Thank You.
[Message sent by forum member 'mp_prabu' (mp_prabu)]

http://forums.java.net/jive/thread.jspa?messageID=320790

===========================================================================
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".

===========================================================================
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