I want to print this in a pdf created by PDFBOX. It wont let me insert tabs and spaces because the font does not support them. Why is this a problem, and more importantly, how can I fix it?
StudentData student = listOfDebtors.get(j);
contentStream.beginText();
contentStream.setFont(font, 8);
contentStream.newLineAtOffset(xPosition, yPosition);
contentStream.showText("Member #:"+ student.getMembershipNumber() + ""
+ "Grade:" + getStudentGradeInSchool(student.getYearGraduate()) + ""
+ "Year Joined" + student.getYearJoined() + "
"
+ "Name:" + student.getFirstName() + " " + student.getLastName() + "
"
+ "Amount Owed : $" + student.getAmountOwed());
Error shown:
Caused by: java.lang.IllegalArgumentException: No glyph for U+0009 in font Courier
at org.apache.pdfbox.pdmodel.font.PDType1Font.encode(PDType1Font.java:353)
at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:283)
at org.apache.pdfbox.pdmodel.PDPageContentStream.showText(PDPageContentStream.java:341)
at fbla.rahulshah.database.dataManipulation.PDFCreator.createDebtorPDF(PDFCreator.java:61)
at fbla.rahulshah.database.view.MainScreenController.generateDebtReport(MainScreenController.java:114)
... 62 more
See Question&Answers more detail:os