- Timestamp:
- 9 Jul 2020, 13:25:01 (4 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r16110 r16157 4 4 1.6.1.dev0 (unreleased) 5 5 ======================= 6 7 * Prepare `renderPDFAdmissionLetter` for merging with another pdf document. 8 9 * Add `picture_editable` property attribute to `ApplicantsContainer`. 6 10 7 11 * Add webservice to check if graduated student exists. -
main/waeup.kofa/trunk/setup.py
r15261 r16157 40 40 'zc.async[z3]', 41 41 'z3c.evalexception', 42 'PyPDF2', 42 43 ], 43 44 -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r16126 r16157 23 23 from time import time 24 24 from cStringIO import StringIO 25 from PyPDF2 import PdfFileMerger, PdfFileReader, PdfFileWriter 25 26 from reportlab.lib import colors 26 27 from reportlab.lib.units import cm … … 405 406 406 407 def setPaymentDetails(self, category, student, 407 previous_session , previous_level, combi=[]):408 previous_session=None, previous_level=None, combi=[]): 408 409 """Create a payment ticket and set the payment data of a 409 410 student for the payment category specified. … … 878 879 pre_text=None, post_text=None, 879 880 topMargin = 1.5, 880 letterhead_path=None): 881 letterhead_path=None, 882 mergefiles=None, watermark=None): 881 883 """Render pdf admission letter. 882 884 """ … … 936 938 note=post_text, topMargin=topMargin, 937 939 letterhead_path=letterhead_path) 940 if mergefiles: 941 merger = PdfFileMerger() 942 merger.append(StringIO(pdf_stream)) 943 if watermark: 944 watermark = PdfFileReader(watermark) 945 for file in mergefiles: 946 if watermark: 947 # Pass through all pages of each file 948 # and merge with watermark page. 949 marked_file = PdfFileWriter() 950 orig_file = PdfFileReader(file[1]) 951 num_pages = orig_file.getNumPages() 952 for num in range(num_pages): 953 page = orig_file.getPage(num) 954 page.mergePage(watermark.getPage(0)) 955 marked_file.addPage(page) 956 # Save into a file-like object 957 tmp1 = StringIO() 958 marked_file.write(tmp1) 959 # Append the file-like object 960 merger.append(tmp1) 961 else: 962 # Just append the file object 963 merger.append(file[1]) 964 # Save into a file-like object 965 tmp2 = StringIO() 966 merger.write(tmp2) 967 return tmp2.getvalue() 938 968 return pdf_stream 939 969 -
main/waeup.kofa/trunk/versions.cfg
r15797 r16157 50 50 Pygments = 2.0.2 51 51 pyprof2calltree = 1.1.1 52 PyPDF2 = 1.25.1 52 53 reportlab = 2.5 53 54 repoze.profile = 2.0
Note: See TracChangeset for help on using the changeset viewer.