Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5081970

Printing image data through URL is broken when using DocFlavor constr on win32

XMLWordPrintable

    • 2d
    • beta
    • x86
    • windows_xp
    • Verified

        Platform: WinXP Prof
        Printer: Lexmark Optra T610, HP LaserJet 4050N
        Driver: PCL
        JDK: Occurs since JDK1.4
        Data: GIF, JPEG, PNG images with URL representation class.

        I am printing a jpeg file to a PCL printer using the DocFlavor - image/jpeg, java.net.URL and Java Print Service APIs. Instead of using the built-in flavor (DocFlavor.URL.JPEG) I am creating a new doc flavor through the constructor passing the above mentioned mime type and the representation class. When the image is printed, I am getting 100s of pages of junk data on WinXP.

        This occurs only when I am using a DocFlavor constructor. This works fine when using the built-in DocFlavor. This is not reproducible on Xerox Docuprint N4025 PS printer. This occurs for any image print data that is printed through URL class.

        I have attached a sample test. Execute the sample test. Make sure you have a default PCL printer configured on your system. If the printer prints junk data, the bug is reproduced.
        ****Beware of the fact that this bug produces huge junk data and hence your printer will keep on printing 100s of pages unless you cancel the job****
        -----------------------------------------------------------------------------

        Printing the print data to a file using the above doc flavor actually copies the source image into the destination file specified. The output file is not a PS or a PCL file but it is just an image file. I think since the 'if' condition is not satisfied, an input stream is obtained from the URL and passed to the printer, when inturn gets dumped into the destination file specified.

        ###@###.### 2004-08-05

              jgodinez Jennifer Godinez (Inactive)
              pmohansunw Praveen Mohan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: