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

Printing text to a file does not honor the attributes specified, on Solaris

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • client-libs
    • 2d
    • sparc
    • solaris_9

      I am trying to print a text file created with UTF_8 encoding to a file using the print service available on my Solaris system. Initially I verified whether the doc flavor INPUT_STREAM.PLAIN_TEXT_UTF_8 is supported in combination with the attributes copies and destination, by calling isAttributeValueSupported() method available in the print service. Print Service claims that it supports all of them. But when I print it to a file, the source text file is just copied to the destination file that I specified and the copies attribute is ignored. When I tried this application with JPG/PNG images, a post script file is getting created which has all the attributes such as collate, copies etc. So when I print the postscript file to the printer, i am getting 2 copies of the print data. But this does not seem to be happening in case of Text.

      1. PrintService should not claim to support the 'Destination' attribute for text flavors if the output file is going to be just the replica of the source file.

      2. isAttributeValueSupported() must consider whether the given attribute set contains destination attribute before returning true/false value for the copies attribute, for the text flavor.

      This is reproducible right from JDK1.4 on Solaris. Text flavors are not supported on Win32. I tested this on Solaris9 without CUPS, using Xerox Docuprint N4025 printer.

      I have attached a sample testcase. Execute the sample testcase. This testcase would print the contents of an UTF encoded text file to another file. Compare the input and output files. If they are same, then the bug is reproduced.
      This is already fixed in 7.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: