k'PythonReportlab§lReportlabÆS©Á2010c107FContents1ReportlabSSSCCC12{{{üüü~~~fff23Canvas24kkk'''platypus35PythonreportlabLLL|||66Pythonreportlab-ãããLLL87(((ååå11Áµ3python.p§ÑÑ¿ØU÷v^rI¦§reportlab´pythonþéÐm`DPDFLa¥§©þk'TreportlabÆS]§ø ÆSë1ReportlabSSSCCCÄuPython²`DPDFLa¥Reportlab§ØáuPythonIOa¥§¤±7LÃÄe1a¥¿SCÏ9rã¡=PDF§¤±IPythonimaginglibrary(PIL)a¥üa¥e1/µReportLab::k|±Python2.X§O3.xé¯ÑSC{µwindows^r±e1.exeSC§SCXJ´linux^r§±e1èSC(ïÆkSCPIL)SC{(IrSCè3pythonSC8¹Ü· )µ1$pythonsetup.pyinstallSC ±$1g~f§Ï~3Lib/site-packages/reportlab/test8¹e§\±ÏL±e-$1¤k~fµ$cd/usr/local/Python.2.4.3/Lib/site-packages/reportlab/test$pythonrunAll.py..............................................................................................................-------------------------------------------------------Ran143testsin45.886sOKLogsandoutputfileswrittentofolder.../ReportLab_tmp/reportlab_testÙ¢\XJ´windows^r Ø'%ù~f§±aL§I3pythonshellÑ\importreportlab.pdfgenÿÁ´ÄSC(SCÒØ[`2{{{üüü~~~fffe¡5ww1~f§ÆÙ¦§k5ww{üHelloWorld§S3Reportlab¥$?|Ò´3pdfgen¥canvasé§ 3ùp#N^r¦^©§ã¡Mïg½ÂPDF©L5wèµ1µCreatedonAug23,2010@author:leyond.info2µfromreportlab.pdfgenimportcanvas3µc=canvas.Canvas(hello.pdf)4µc.drawString(100,750,HelloWorld!)5µc.showPage()6:c.save()é{ü§¦^ReportLab5)¤PDF\±@Ò´3xã§Ïd11lpdf-gen¥\canvas§Om©±xÄk¦^Canvasé)¤¶hello.pdf©§, ¦^drawString{3canvas¥100@100?±xÑ.HelloWorld!.iùpI5¿I §Ï~·:I3þ§reportlab%´3e§ù:Ø· showPage()^u)©§du ¡vkSN§vkåJ§d3ù~f¥§±íØù1è 1èòc±x¤kSN\©§ÄKò)xSN$1è ò3éA8¹e)¤hello.pdf©§þ¡ýAãg-13Canvase5wwXÛreportlab¥canvasCanvas%@A4,XJ-þSN&µ§@kTXÛQºÄkI\letter¬µ1:fromreportlab.lib.pagesizesimportletter, 3MïCanvasé´½pagesize:1:canvas=canvas.Canvas('myfile.pdf',pagesize=letter)·±wwCanvas(Ù¦á5µ21:Pythonreportlab-helloworlddef__init__(self,filename,pagesize=letter,bottomup=1,pageCompression=0,encoding=rl_config.defaultEncoding,verbosity=0encrypt=None):õ]ÕëReportlabUserGuidee5·wwXÛ|^pagesizeCanvas&µ~fµ5wwèµ1:fromreportlab.lib.pagesizesimportletter2:fromreportlab.pdfgenimportcanvas3:canvas=canvas.Canvas(form.pdf,pagesize=letter)4:canvas.setLineWidth(.3)5:canvas.setFont('Helvetica',12)6:canvas.drawString(30,750,'OFFICIALCOMMUNIQUE')7:canvas.drawString(30,735,'OFACMEINDUSTRIES')8:canvas.drawString(500,750,12/12/2010)9:canvas.line(480,747,580,747)10:canvas.drawString(275,725,'AMOUNTOWED:')11:canvas.drawString(500,725,$1,000.00)12:canvas.line(378,723,580,723)13:canvas.drawString(30,703,'RECEIVEDBY:')14:canvas.line(120,700,580,700)15:canvas.drawString(120,703,JOHNDOE)16:canvas.save()ù´{üâü~f§cHelloworld~fØÓ?3ucanvas.line(),\±ÏL½éX,Y53canvasþxXJ±§±^§5±L§w,ù'¡Ù¦¼ê'XsetLineWidth(.3),ù-^uwreportlab±õo)5±ãk\±ÏLsetFont¼ê5½iNÚ32:pdf-partial-form-g2$1è ò3éA8¹e)¤myle.pdf©§þ¡ýAãg-24kkk'''platypuswwE,platypus,platypus¡Pagelayoutandtopologyusingscript,´«p ÙÛa¥§B^r±ÏL§S{üMïE,©Platypus´|Ø%±x§Sa§Jø!©ÙÛ!L!a.±9©õUÏL{ü~fäN`²§Xeã§ù´Êv±ÏüµùX{´~f§Ïü´ØUkpythonlogo35wèµ1:importtime2:fromreportlab.lib.enumsimportTA_JUSTIFY3:fromreportlab.lib.pagesizesimportletter4:fromreportlab.platypusimportSimpleDocTemplate,Paragraph,Spacer,Image5:fromreportlab.lib.stylesimportgetSampleStyleSheet,ParagraphStyle6:fromreportlab.lib.unitsimportinch7:doc=SimpleDocTemplate(form_letter.pdf,pagesize=letter,8:rightMargin=72,leftMargin=72,9:topMargin=72,10:bottomMargin=18)11:Story=[]12:logo=python_logo.png13:magName=Pythonista14:issueNum=1215:subPrice=99.0016:limitedDate=03/05/201017:freeGift=tinfoilhat18:formatted_time=time.ctime()19:full_name=MikeDriscoll20:address_parts=[411StateSt.,Marshalltown,IA50158]21:im=Image(logo,2*inch,2*inch)22:Story.append(im)23:styles=getSampleStyleSheet()424:styles.add(ParagraphStyle(name='Justify',alignment=TA_JUSTIFY))25:ptext='fontsize=12%s/font'%formatted_time26:Story.append(Paragraph(ptext,styles[Normal]))27:Story.append(Spacer(1,12))28:#Createreturnaddress29:ptext='fontsize=12%s/font'%full_name30:Story.append(Paragraph(ptext,styles[Normal]))31:forpartinaddress_parts:32:ptext='fontsize=12%s/font'%part.strip()33:Story.append(Paragraph(ptext,styles[Normal]))34:Story.append(Spacer(1,12))35:ptext='fontsize=12Dear%s:/font'%full_name.split()[0].strip()36:Story.append(Paragraph(ptext,styles[Normal]))37:Story.append(Spacer(1,12))38:ptext='fontsize=12Wewouldliketowelcomeyoutoour39:subscriberbasefor%sMagazine!\40:Youwillreceive%sissuesatthe41:excellentintroductorypriceof$%s.42:Pleaserespondby\%stostartreceiving43:yoursubscriptionandgetthefollowing44:freegift:%s./font'45:%(magName,46:issueNum,47:subPrice,48:limitedDate,49:freeGift)50:Story.append(Paragraph(ptext,styles[Justify]))51:Story.append(Spacer(1,12))