-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
8, 11, 17, 24
-
x86_64
-
os_x
ADDITIONAL SYSTEM INFORMATION :
OS X - sequoia - 15.5
Apache PDF BOX - 3.0.5
A DESCRIPTION OF THE PROBLEM :
Printing a pdf file with a specific page using the print dialog fails. Print is not done.
REGRESSION : Last worked in version 24.0.2
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run the example code mentioned in this mail, after setting the "file" to a valid PDF file.
2. Select "Range from" option on the displayed print settings dialog.
3. Type "2" in both the "from" and "to" text boxes.
4. Click Print.
5. Notice that the application just quits.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Print the document on the printer.
ACTUAL -
App quits (somtimes crashes) with doing nothing.
---------- BEGIN SOURCE ----------
import java.awt.print.PrinterJob;
import java.io.File;
import org.apache.pdfbox.Loader;
import org.apache.pdfbox.io.RandomAccessReadBufferedFile;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.printing.PDFPageable;
public class ApachePdfPrintTest {
private static final File file = new File("PATH_TO_PDF_FILE");
public static void main(String[] args) {
try {
final PrinterJob pJob = PrinterJob.getPrinterJob();
//final PDDocument doc = PDDocument.load(file);
final PDDocument doc = Loader.loadPDF(new RandomAccessReadBufferedFile(file));
pJob.setPageable(new PDFPageable(doc));
if (pJob.printDialog()) {
pJob.print();
}
} catch (final Exception e) {
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
OS X - sequoia - 15.5
Apache PDF BOX - 3.0.5
A DESCRIPTION OF THE PROBLEM :
Printing a pdf file with a specific page using the print dialog fails. Print is not done.
REGRESSION : Last worked in version 24.0.2
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Run the example code mentioned in this mail, after setting the "file" to a valid PDF file.
2. Select "Range from" option on the displayed print settings dialog.
3. Type "2" in both the "from" and "to" text boxes.
4. Click Print.
5. Notice that the application just quits.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Print the document on the printer.
ACTUAL -
App quits (somtimes crashes) with doing nothing.
---------- BEGIN SOURCE ----------
import java.awt.print.PrinterJob;
import java.io.File;
import org.apache.pdfbox.Loader;
import org.apache.pdfbox.io.RandomAccessReadBufferedFile;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.printing.PDFPageable;
public class ApachePdfPrintTest {
private static final File file = new File("PATH_TO_PDF_FILE");
public static void main(String[] args) {
try {
final PrinterJob pJob = PrinterJob.getPrinterJob();
//final PDDocument doc = PDDocument.load(file);
final PDDocument doc = Loader.loadPDF(new RandomAccessReadBufferedFile(file));
pJob.setPageable(new PDFPageable(doc));
if (pJob.printDialog()) {
pJob.print();
}
} catch (final Exception e) {
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
- duplicates
-
JDK-8297191 [macos] printing page range "page 2 to 2" or "page 2 to 4" on macOS leads to not print
-
- Open
-