0

I am using Apache PDFBox 1.8.6 to silent print pdf bytes stored in the database.

The print output by PDFBox does not display data in the font I have used in the PDF. The PDF(exported from Crystal reports) has Embedded Subset True Type fonts (Times Roman, Arial Bold) etc. While searching, I found this link from stack overflow which says "PDFBox is not able to parse embedded subsets of TrueType fonts." But it was dated Aug 2012 and I am using latest version of PDFBox. It seems the problem persists in the current version.

When I silent print the bytes, all the characters are displayed in Helvetica font(not sure how this is being applied).

InputStream myInputStream = new ByteArrayInputStream(myBytes); 
PDDocument doc = PDDocument.load(myInputStream);
// TODO : Apply custom fonts??
doc.silentPrint();
  1. Is there a way to solve this issue by loading fonts programmatically and applying it to the loaded pdf document?
Community
  • 1
  • 1
BharatB
  • 41
  • 3
  • PDFBox printing capabilities have much improved in the 2.0.0 development version. You may consider switching to a current snapshot. E.g. see [here](http://stackoverflow.com/a/21547909/1729265) – mkl Sep 04 '14 at 11:52
  • Another problem with the latest 1.8.* versions is that java can't render certain type1 fonts (CMR, CMI, etc - you find them often in articles meant to have a "scientific journal" style). – Tilman Hausherr Sep 04 '14 at 18:29

0 Answers0