protected void lastPage() throws DocumentException { while (iLineNo < sNrLines) { out(""); iLineNo++; } printFooter(); }
protected void printFooter() throws DocumentException { out(""); out( renderEnd( renderMiddle("", "Page " + (iPageNo + 1)), "<" + iCurrentSubjectArea.getSubjectAreaAbbreviation() + (iCourseNumber != null ? " " + iCourseNumber : "") + "> ")); // FIXME: For some reason when a line starts with space, the line is shifted by one space in the // resulting PDF (when using iText 5.0.2) Paragraph p = new Paragraph(iBuffer.toString().replace("\n ", "\n "), PdfFont.getFixedFont()); p.setLeading(9.5f); // was 13.5f iDoc.add(p); iBuffer = new StringBuffer(); iPageNo++; }
protected void newPage() throws DocumentException { while (iLineNo < sNrLines) { out(""); iLineNo++; } printFooter(); iDoc.newPage(); printHeader(); }
protected void printHeader() throws DocumentException { out( renderMiddle( ApplicationProperty.WorksheetPdfAuthor.value().replace("%", Constants.getVersion()), ApplicationProperty.WorksheetPdfTitle.value())); out( mpad( new SimpleDateFormat("EEE MMM dd, yyyy").format(new Date()), iCurrentSubjectArea.getSession().getAcademicInitiative() + " " + iCurrentSubjectArea.getSession().getAcademicTerm() + " " + iCurrentSubjectArea.getSession().getAcademicYear(), ' ', sNrChars)); outln('='); iLineNo = 0; if (iCourseOffering != null) println("(" + iCourseOffering.getCourseName() + " Continued)"); }
protected void println(String text) throws DocumentException { out(text); iLineNo++; if (iLineNo >= sNrLines) newPage(); }
private void outln(char ch) throws DocumentException { out(rep(ch, sNrChars)); }