RFR: 8377602: Create automated test for PageRange [v2]

Prasanta Sadhukhan psadhukhan at openjdk.org
Thu Feb 26 03:08:22 UTC 2026


On Wed, 25 Feb 2026 11:30:57 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> test/jdk/java/awt/print/PrinterJob/PageRangesAuto.java line 97:
>> 
>>> 95:         String fileName = pageRange == null
>>> 96:                           ? baseName + "-all.pdf"
>>> 97:                           : String.format("%s-%d-%d.pdf",
>> 
>> I believe `Destination` creates file in .prn or .ps format and not .pdf..
>> https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/javax/print/attribute/standard/Destination.html
>> 
>>> A common use for this attribute will be applications which want to redirect output to a local disk file : eg."file:out.prn"
>> 
>> I am not able to open this file atleast in Windows as Acrobat fails to recognize the file type even though its pdf
>
> On macOS, it creates valid PDF files, all the files are viewable in the Preview utility.
> 
> On Windows, all these files open just fine in Firefox and Edge.

I am not sure..It doesn't open for me in my Firefor or Edge too. The filetype being created it seems xpif which is not pdf

%-12345X at PJL JOB
@PJL XCPT <?xml version="1.0" encoding="UTF-8"?>
@PJL XCPT <!DOCTYPE xpif SYSTEM "xpif-v02082.dtd">
@PJL XCPT <xpif version="1.0" cpss-version="2.07" xml:lang="en-US">

Also, other printing tests which uses Destination class like
java/awt/print/Dialog/PrintDlgApp.java
java/awt/print/PrinterJob/DeviceScale.java
java/awt/print/PrinterJob/PrintAfterEndTest.java
java/awt/print/PrinterJob/PrintCrashTest.java
java/awt/print/PrinterJob/PrintNullString.java
java/awt/print/PrinterJob/PrintTextPane.java
java/awt/print/PrinterJob/PrintToFileTest.java
all uses .prn or .ps so maybe there's a reason to it..

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29660#discussion_r2856640521


More information about the client-libs-dev mailing list