Changeset 10565 for main/waeup.kofa
- Timestamp:
- 30 Aug 2013, 05:10:32 (11 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pdf.py
r10554 r10565 540 540 logo_pos = [0, 0, 0] 541 541 logo_left_pos = [0, 0, 0] 542 pagesize = portrait(A4) 542 543 543 544 @classmethod … … 804 805 805 806 def create_pdf(self, data, headerline=None, title=None, author=None, 806 footer='', note=None, sigs_in_footer=[], topMargin=1.5, 807 pagesize=portrait(A4)): 807 footer='', note=None, sigs_in_footer=[], topMargin=1.5): 808 808 """Returns a binary data stream which is a PDF document. 809 809 """ … … 815 815 topMargin=topMargin*inch, 816 816 title=title, 817 pagesize= pagesize,817 pagesize=self.pagesize, 818 818 showBoundary=False, 819 819 ) … … 835 835 pdf_stream.close() 836 836 return result 837 838 class LandscapePDFCreator(PDFCreator): 839 """A utility to help with generating PDF docs in 840 landscape format. 841 """ 842 grok.name('landscape') 843 pagesize = landscape(A4) -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/level_report.py
r10564 r10565 70 70 from reportlab.lib.units import cm 71 71 from reportlab.platypus import Paragraph, Table, Spacer 72 from reportlab.lib.pagesizes import A4, landscape73 72 from waeup.kofa.reports import IReport, IReportGenerator 74 73 from waeup.kofa.reports import Report … … 130 129 131 130 def create_pdf(self): 132 creator = getUtility(IPDFCreator )131 creator = getUtility(IPDFCreator, name='landscape') 133 132 table_data = tbl_data_to_table(self.data) 134 133 #col_widths = [3.5*cm] * len(self.data[0]) … … 146 145 pdf_data, None, doc_title, self.author, 147 146 'Level Report %s/%s/%s/%s' % ( 148 self.faccode, self.depcode, self.levelcode, self.sessioncode) ,149 pagesize=landscape(A4))147 self.faccode, self.depcode, self.levelcode, self.sessioncode) 148 ) 150 149 return pdf 151 150 -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/student_statistics.py
r10559 r10565 85 85 from reportlab.lib.units import cm 86 86 from reportlab.platypus import Paragraph, Table, Spacer 87 from reportlab.lib.pagesizes import A4, landscape88 87 from waeup.kofa.reports import IReport, IReportGenerator 89 88 from waeup.kofa.reports import Report … … 136 135 137 136 def create_pdf(self): 138 creator = getUtility(IPDFCreator )137 creator = getUtility(IPDFCreator, name='landscape') 139 138 table_data = tbl_data_to_table(*self.data) 140 139 col_widths = [None,] + [1.6*cm] * len(self.data[1]) + [None,] … … 147 146 pdf = creator.create_pdf( 148 147 pdf_data, None, doc_title, self.author, 149 'Students in Session %s' % self.session ,150 pagesize=landscape(A4))148 'Students in Session %s' % self.session 149 ) 151 150 return pdf 152 151
Note: See TracChangeset for help on using the changeset viewer.