Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.8.4, 1.8.5
-
None
-
None
-
None
Description
When trying to silent print a document following error occurs:
org.apache.pdfbox.pdmodel.font.PDType0Font getawtFont
Information: Using font SansSerif.plain instead of Verdana
SilentPrint.java
try { DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE; String psMimeType = DocFlavor.BYTE_ARRAY.POSTSCRIPT.getMimeType(); StreamPrintServiceFactory[] factories = StreamPrintServiceFactory.lookupStreamPrintServiceFactories(flavor, psMimeType); String pdffile = "c:\\temp\\TabelleTest.pdf"; String psfile = "c:\\temp\\temp.ps"; PDDocument doc = PDDocument.load(pdffile); // Open the output file FileOutputStream fos = new FileOutputStream(psfile); ByteArrayOutputStream bout = new ByteArrayOutputStream(); // Use the first service available PrintService sps = factories[0].getPrintService(bout); // Define paper size PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet(); aset.add(MediaSizeName.ISO_A4); PrinterJob pjob = PrinterJob.getPrinterJob(); pjob.setPrintService(sps); doc.silentPrint(pjob); doc.close(); fos.write(bout.toByteArray()); fos.close(); } catch (Throwable t) { t.printStackTrace(); }
Attachments
Attachments
Issue Links
- duplicates
-
PDFBOX-490 Pdf Printing of text from embedded fonts
- Closed
- is related to
-
PDFBOX-2064 java.lang.ArrayIndexOutOfBoundsException in CompositeImage.createMaskedImage
- Closed
- relates to
-
PDFBOX-1689 Partial failure to render PDF
- Closed