-
Bug
-
Resolution: Unresolved
-
P4
-
8, 11, 17
-
In Review
-
generic
-
os_x
ADDITIONAL SYSTEM INFORMATION :
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
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
- links to
-
Review openjdk/jdk/11266
-
Review(master) openjdk/jdk/19740