-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P3
-
Affects Version/s: 8, 11, 17
-
Component/s: client-libs
-
b06
-
generic
-
os_x
| Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
|---|---|---|---|---|---|---|
| JDK-8377610 | 25.0.4-oracle | Alexey Ivanov | P3 | Resolved | Fixed | master |
Java Version 17.0.5+8, macOS 12.6.1
A DESCRIPTION OF THE PROBLEM :
When on macOS you select a multi page document for printing, for example print "page 2 to 2" or "page 2 to 4, leads to not printing the selected pages at all. This happens as well as printing from swing and also when printing from Java FX.
The error is located in the file java.desktop/macosx/native/libawt_lawt/awt/CPrinterJob.m on the tag jdk-17+35 in line 615:
jobject page = (*env)->CallObjectMethod(env, jthis, jm_getPageFormat, 0); // AWT_THREADING Safe (!appKit)
Instead there must be written:
jobject page = (*env)->CallObjectMethod(env, jthis, jm_getPageFormat, firstPage); // AWT_THREADING Safe (!appKit)
to fix the error.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Print a multi page document from swing or Java FX and select in the printing dialog a page range from "page 2 to 2".
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Page 2 from the multi page document is printed.
ACTUAL -
The selected page is not printed (empty page instead).
FREQUENCY : always
To reproduce the problem, run test/jdk/java/awt/print/PrinterJob/PageRanges.java in JDK source code.
- backported by
-
JDK-8377610 [macos] Printing a page range with starting page > 1 results in missing pages
-
- Resolved
-
- duplicates
-
JDK-8294534 [macos13] JTablePrintPageRangesTest fails to print when page number 1 is not given in range
-
- Closed
-
-
JDK-8364428 [macOS] Printing a PDF by entering a page range of 2 to 2 fails—no output is produced
-
- Closed
-
- relates to
-
JDK-8377602 Create automated test for PageRange
-
- In Progress
-
-
JDK-8373239 Test java/awt/print/PrinterJob/PageRanges.java fails with incorrect selection of printed pages
-
- Resolved
-
- links to
-
Commit(master)
openjdk/jdk/5ba91fed
-
Review(master)
openjdk/jdk26u/49
-
Review(master)
openjdk/jdk/11266
-
Review(master)
openjdk/jdk/19740