On Mon, 5 Oct 2026 13:19:51 GMT, Prasanta Sadhukhan <[email protected]> 
wrote:

>>> I tried print-to-pdf where it prints 2 page but print has Page0-Page1 text
>> 
>> This is expected as PDF printer drivers do not support collation since it 
>> only generates a single digital file than multiple copies.
>> 
>>> I tried in Xerox AltaLink printer ... but it prints 2 blank page.
>> 
>> This could be any number of things but my guess is that the printer does not 
>> support PostScript (pages would not be blank otherwise). Is this also with 
>> the current commits applied, or with the additional changes I recommended?
>> 
>> Another debugging step we could take is manually feeding the following 
>> PostScript content manually to `lpr` with the command output you just sent:
>> 
>> [document.txt](https://github.com/user-attachments/files/33047893/document.txt)
>> 
>> And then print it like so (after renaming back to "document.ps"):
>> 
>> 
>> lpr -PAltaLink-B8145 -JJava Printing -#2 -h -o collate=true document.ps
>> 
>> 
>> This means we could then work out what is the bad combo of options, or if it 
>> is actually the printer drivers separate to OpenJDK that is the culprit.
>
>> my guess is that the printer does not support PostScript
> 
> You might be correct but it also tells that this test might not be enough to 
> test the original UnixPrintJob codepath as it is not going via that route..

Hi @prsadhuk and @prrace would you mind going through the following 
reproduction steps and document ALL your results. So far I will more 
information from both of you to work out what is going wrong with all our 
available printer setups. I have also added a test that targets `UnixPrintJob` 
by allowing a document selection (other two tests force the use of 
`PSPrinterJob` through the `Printable` interface) only as well to get a full 
range of results. The reproductions steps are:

1. Start the Collate2DPrintingTest application.
2. Run the "Print2D Wizard" test and document the following outputs:
   - How many pages were printed
   - How many copies were printed
   - Whether the copies were collated
   - If the content is correct
   - The `PSPrinterJob>>` output for the `lpr` command
3. Run the "Print2D Wizard" test again but with "/Collate true" removed and 
document:
   - How many pages were printed
   - How many copies were printed
   - Whether the copies were collated
   - If the content is correct
   - The `PSPrinterJob>>` output for the `lpr` command
4. Run the "PrintService Default" test and document the following outputs:
   - How many pages were printed
   - How many copies were printed
   - Whether the copies were collated
   - If the content is correct
   - The `PSPrinterJob>>` output for the `lpr` command
5. Run the "PrintService Default" test but with "/Collate true" removed and 
document:
   - How many pages were printed
   - How many copies were printed
   - Whether the copies were collated
   - If the content is correct
   - The `PSPrinterJob>>` output for the `lpr` command
6. Run the "PrintService Document" test with the "document.ps" file from before:
   - How many pages were printed
   - How many copies were printed
   - Whether the copies were collated
   - If the content is correct
   - The `PSPrinterJob>>` output for the `lpr` command
   - And the `UnixPrintJob>>` output for the `lpr` command
7. Run the "PrintService Document" test with the "document.ps" file with the 
"/Collate true" option removed and document:
   - How many pages were printed
   - How many copies were printed
   - Whether the copies were collated
   - If the content is correct
   - The `PSPrinterJob>>` output for the `lpr` command
   - And the `UnixPrintJob>>` output for the `lpr` command

I understand that is a lot of testing, however we need more test results from a 
variety of situations and printers to accurately determine what is going on. 
Additionally could you both document the printer details with the following 
commands:


lpstat -v  # to list all printer devices and their names
lpoptions -p <PRINTER_NAME> -l # to get basic options available
cat /etc/cups/ppd/<PRINTER_NAME> # to get all driver details for printer

-------------

PR Comment: https://git.openjdk.org/jdk/pull/33023#issuecomment-6008627720

Reply via email to