Changeset 8257 for main/waeup.kofa/trunk/src/waeup/kofa/browser
- Timestamp:
- 23 Apr 2012, 11:56:06 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/browser
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/interfaces.py
r8059 r8257 178 178 """A callback function to render background of PDFs. 179 179 """ 180 def create_pdf(data, headerline=None, title=None ):180 def create_pdf(data, headerline=None, title=None, note=None): 181 181 """Create a PDF. 182 182 … … 188 188 the top bar. 189 189 190 `note` is optional HTML markup added at bottom of created 191 document. 192 190 193 If no `headerline` is given, a default will be rendered (name 191 194 of university). -
main/waeup.kofa/trunk/src/waeup/kofa/browser/pdf.py
r8234 r8257 71 71 ) 72 72 73 #: A reportlab paragraph style for notes output at end of documents. 74 NOTE_STYLE = ParagraphStyle( 75 name='Note', 76 parent=NORMAL_STYLE, 77 fontName='Helvetica', 78 fontSize=12, 79 ) 80 73 81 def format_html(html): 74 82 """Make HTML code usable for use in reportlab paragraphs. … … 349 357 350 358 def create_pdf(self, data, headerline=None, title=None, author=None, 351 footer='' ):359 footer='', note=None): 352 360 """Returns a binary data stream which is a PDF document. 353 361 """ … … 367 375 doc.kofa_author = author 368 376 doc.kofa_footer = footer 377 if note is not None: 378 html = format_html(note) 379 data.append(Paragraph(html, NOTE_STYLE)) 369 380 doc.build(data, onFirstPage=self.paint_background, 370 381 onLaterPages=self.paint_background,
Note: See TracChangeset for help on using the changeset viewer.