Am 31.07.2025 um 06:06 schrieb Seethalakshmi Sathya:
I tested with another text only multipage PDF and the results are the same.
I would like to know how to file a bug for this?
I think the bug is in the jdk, and I'll write something small later to
prove this. In the meantime:
What happens if you do it with PDFDebugger, does it just quit? Or does
it show an exception? Or just do nothing?
https://www.apache.org/dyn/closer.lua/pdfbox/3.0.5/debugger-app-3.0.5.jar
What happens if you don't use the dialog box but pass the range like this?
|PrintRequestAttributeSet attribs = new HashPrintRequestAttributeSet();
attribs.add(new PageRanges(2, 2));|
and then call print(|attribs|) without calling printDialog() first ?
Tilman
On Wed, Jul 30, 2025 at 7:15 PM Tres Finocchiaro<tres.finocchi...@gmail.com>
wrote:
"org.apache.pdfbox.printing.PDFPageable.PDFPageable(PDDocument)" does
not work as expected when printing a specific page using the print
dialog.
3. Type "2" in both the "from" and "to" text boxes.
4. Click Print.
I was able to confirm that page-rage does not work as expected, it prints
nothing. I tested on a physical printer (inkjet) as well as a virtual
printer (PDFwriter).
I tested this same code on Windows and the bug does not occur, page 2 is
printed.
I tested this code against my own app and it works on macOS. This is
because I do not rely on the print dialog but rather provide my own
PageRanges handling code (using Splitter).
This appears to be a bug with either PDFBOX or the JVM. I would recommend
baseline testing this bug against another multipage document to see where
the bug lies and filing a bug report appropriately.
5. Notice that the application just quits.
"Quit" is ambiguous however assuming you mean "crash"? If so, the crashing
is NOT reproducible on my machine. I tested by placing a message dialog
after the call to print and it shows every time (Java 11).
pJob.print();
JOptionPane.showMessageDialog(null, "Here!");
If your application quits, this may be JVM-specific or macOS-specific with
how you package your application.