load into temp file
This commit is contained in:
parent
2bfb9c1803
commit
66b2c07380
1 changed files with 2 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
package org.xbib.graphics.pdfbox.print;
|
package org.xbib.graphics.pdfbox.print;
|
||||||
|
|
||||||
|
import org.apache.pdfbox.io.MemoryUsageSetting;
|
||||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||||
import org.apache.pdfbox.printing.PDFPageable;
|
import org.apache.pdfbox.printing.PDFPageable;
|
||||||
|
|
||||||
|
@ -88,7 +89,7 @@ public class PrintUtility {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void print(InputStream inputStream, Printer printer) throws Exception {
|
public static void print(InputStream inputStream, Printer printer) throws Exception {
|
||||||
PDDocument document = PDDocument.load(inputStream);
|
PDDocument document = PDDocument.load(inputStream, MemoryUsageSetting.setupTempFileOnly());
|
||||||
PrinterJob job = PrinterJob.getPrinterJob();
|
PrinterJob job = PrinterJob.getPrinterJob();
|
||||||
job.setPageable(new PDFPageable(document));
|
job.setPageable(new PDFPageable(document));
|
||||||
job.setPrintService(printer.getService());
|
job.setPrintService(printer.getService());
|
||||||
|
|
Loading…
Reference in a new issue