예제 #1
0
 protected void lastPage() throws DocumentException {
   while (iLineNo < sNrLines) {
     out("");
     iLineNo++;
   }
   printFooter();
 }
예제 #2
0
 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++;
 }
예제 #3
0
 protected void newPage() throws DocumentException {
   while (iLineNo < sNrLines) {
     out("");
     iLineNo++;
   }
   printFooter();
   iDoc.newPage();
   printHeader();
 }
예제 #4
0
 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)");
 }
예제 #5
0
 protected void println(String text) throws DocumentException {
   out(text);
   iLineNo++;
   if (iLineNo >= sNrLines) newPage();
 }
예제 #6
0
 private void outln(char ch) throws DocumentException {
   out(rep(ch, sNrChars));
 }