当前位置: 首页>>代码示例>>Python>>正文


Python SimpleDocTemplate.__init__方法代码示例

本文整理汇总了Python中reportlab.platypus.SimpleDocTemplate.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleDocTemplate.__init__方法的具体用法?Python SimpleDocTemplate.__init__怎么用?Python SimpleDocTemplate.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在reportlab.platypus.SimpleDocTemplate的用法示例。


在下文中一共展示了SimpleDocTemplate.__init__方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from reportlab.platypus import SimpleDocTemplate [as 别名]
# 或者: from reportlab.platypus.SimpleDocTemplate import __init__ [as 别名]
    def __init__(self, invoice_path, pdf_info=None):
        if not pdf_info:
            pdf_info = self.default_pdf_info

        SimpleDocTemplate.__init__(
            self,
            invoice_path,
            pagesize=letter,
            rightMargin=inch,
            leftMargin=inch,
            topMargin=inch,
            bottomMargin=inch,
            **pdf_info.__dict__
        )

        self._defined_styles = getSampleStyleSheet()
        self._defined_styles.add(
            ParagraphStyle('RightHeading1', parent=self._defined_styles.get('Heading1'), alignment=TA_RIGHT)
        )
        self._defined_styles.add(
            ParagraphStyle('TableParagraph', parent=self._defined_styles.get('Normal'), alignment=TA_CENTER)
        )

        self.invoice_info = None
        self.service_provider_info = None
        self.client_info = None
        self.is_paid = False
        self._items = []
        self._item_tax_rate = None
        self._transactions = []
        self._story = []
        self._bottom_tip = None
        self._bottom_tip_align = None
开发者ID:k-pom,项目名称:PyInvoice,代码行数:35,代码来源:templates.py

示例2: __init__

# 需要导入模块: from reportlab.platypus import SimpleDocTemplate [as 别名]
# 或者: from reportlab.platypus.SimpleDocTemplate import __init__ [as 别名]
    def __init__(self, filename, title_left, title_right, portrait=True):
        if portrait is True:
            page_size = A4
            column_width = 8*cm
        else:
            page_size = landscape(A4)
            column_width = 13*cm
        SimpleDocTemplate.__init__(self, filename, pagesize=page_size,
                                   topMargin=0*cm,
                                   leftMargin=2 * cm,
                                   rightMargin=2 * cm,
                                   bottomMargin=0.5 * cm,
                                   )
        self.fileName = filename
        im1 = Image(settings.MEDIA_ROOT + 'logo_EPC.png', width=170, height=80, hAlign=TA_LEFT)
        data = list()
        data.append([im1, ''])
        data.append([Spacer(0, 0.5*cm)])

        data.append([title_left, title_right])
        t = Table(data, colWidths=[column_width]*2, hAlign=TA_LEFT)
        t.setStyle(
            TableStyle(
                [
                    ('SIZE', (0, 0), (-1, -1), 9),
                    ('FONT', (0, 0), (-1, 0), 'Helvetica-Bold'),
                    ('ALIGN', (0, 0), (0, 0), 'LEFT'),
                    ('ALIGN', (1, 0), (-1, -1), 'RIGHT'),
                    ('LINEABOVE', (0, 0), (-1, -1), 0.5, colors.black),
                    ('LINEBELOW', (0, -1), (-1, -1), 0.5, colors.black),
                ]
            )
        )
        self.flowable.append(t)
开发者ID:alazo,项目名称:ase,代码行数:36,代码来源:models.py

示例3: __init__

# 需要导入模块: from reportlab.platypus import SimpleDocTemplate [as 别名]
# 或者: from reportlab.platypus.SimpleDocTemplate import __init__ [as 别名]
 def __init__(self, toc, indexedFlowable, filename, firstPageNumber = 1, **kw ):
     """toc is the TableOfContents object
     indexedFlowale is a dictionnary with flowables as key and a dictionnary as value.
         the sub-dictionnary have two key: 
             text: the text which will br print in the table
             level: the level of the entry( modifying the indentation and the police
     """
     
     self._toc = toc
     self._indexedFlowable = indexedFlowable
     self._filename = filename
     self._part = ""
     self._firstPageNumber = firstPageNumber
     SimpleDocTemplate.__init__(self, filename, **kw)
     setTTFonts()
开发者ID:davidmorrison,项目名称:indico,代码行数:17,代码来源:base.py

示例4: __init__

# 需要导入模块: from reportlab.platypus import SimpleDocTemplate [as 别名]
# 或者: from reportlab.platypus.SimpleDocTemplate import __init__ [as 别名]
 def __init__(self, filename):
     # Sigh.  SimpleDocTemplate is an old-style class
     SimpleDocTemplate.__init__(self, filename,
                                pagesize=pagesizes.letter)
     self.stylesheet = StyleSheet()
     self.header_lines = []
     self._this_section = Section('Untitled')
     # Start with a Spacer for the header on the first page
     self.story = [Spacer(1, 1.5 * units.inch)]
     self.leftMargin = 0.5 * units.inch
     self.rightMargin = self.leftMargin
     self.topMargin = 0.5 * units.inch
     self.bottomMargin = 0.75 * units.inch
     # Record the width and height now, because in the build stage
     # width and height are set to the area inside the margins
     (self.page_w, self.page_h) = pagesizes.letter
开发者ID:mit-fsx,项目名称:surveymonkey-tools,代码行数:18,代码来源:techdiagnostic.py

示例5: __init__

# 需要导入模块: from reportlab.platypus import SimpleDocTemplate [as 别名]
# 或者: from reportlab.platypus.SimpleDocTemplate import __init__ [as 别名]
    def __init__(self, filename, firs, dateStr, notams, mapinfo,
                 mapdata, copyright_holder, **kw):
        SimpleDocTemplate.__init__(self, filename, **kw)
        self.lat0 = mapinfo[0]
        self.lon0 = mapinfo[1]
        self.notams = notams
        self.dateStr = dateStr
        self.firs = firs
        self.bottomOffset = 5*mm
        self.map_data = mapdata
        self.copyright_holder = copyright_holder

        self.mapwidth = self.pagesize[0]-self.rightMargin-self.leftMargin
        self.mapheight = self.pagesize[1]-self.bottomMargin-self.topMargin-\
            self.bottomOffset-20*mm
        self.scale =\
            self.mapwidth/(mapinfo[2]*math.cos(math.radians(self.lat0)))
开发者ID:ahsparrow,项目名称:navplot,代码行数:19,代码来源:notamdoc.py

示例6: __init__

# 需要导入模块: from reportlab.platypus import SimpleDocTemplate [as 别名]
# 或者: from reportlab.platypus.SimpleDocTemplate import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        SimpleDocTemplate.__init__(self, *args, **kwargs)

        self._n_pages = 0
开发者ID:chaabni,项目名称:SmartElect,代码行数:6,代码来源:utils.py

示例7: __init__

# 需要导入模块: from reportlab.platypus import SimpleDocTemplate [as 别名]
# 或者: from reportlab.platypus.SimpleDocTemplate import __init__ [as 别名]
 def __init__(self, filename, **kw):
     SimpleDocTemplate.__init__(self, filename, **kw)
开发者ID:alberto-sanchez,项目名称:PHEDEX,代码行数:4,代码来源:__init__.py

示例8: __init__

# 需要导入模块: from reportlab.platypus import SimpleDocTemplate [as 别名]
# 或者: from reportlab.platypus.SimpleDocTemplate import __init__ [as 别名]
 def __init__(self, filename, **kwargs):
     "Overide to provide baruwa defaults"
     SimpleDocTemplate.__init__(self, filename, **kwargs)
     # self.encrypt = StandardEncryption('', canModify=0)
     self.pagesize = A4
     self.author = 'Baruwa 2.0'
开发者ID:baruwaproject,项目名称:baruwa2,代码行数:8,代码来源:outputformats.py

示例9: __init__

# 需要导入模块: from reportlab.platypus import SimpleDocTemplate [as 别名]
# 或者: from reportlab.platypus.SimpleDocTemplate import __init__ [as 别名]
 def __init__(self, fileName,**kw):
     SimpleDocTemplate.__init__(self,fileName,**kw)
     self.leftMargin, self.rightMargin = 0.5*inch,0.5*inch
     self.topMargin,self.bottomMargin = 0.5*inch,0.5*inch
开发者ID:nnmgy,项目名称:MobileAppTest,代码行数:6,代码来源:ReportGenerator.py

示例10: __init__

# 需要导入模块: from reportlab.platypus import SimpleDocTemplate [as 别名]
# 或者: from reportlab.platypus.SimpleDocTemplate import __init__ [as 别名]
 def __init__(self, *args, **kw):
     SimpleDocTemplate.__init__ (self, *args, **kw)
开发者ID:citizenengagementlab,项目名称:django-pdfbuilder,代码行数:4,代码来源:basetemplates.py


注:本文中的reportlab.platypus.SimpleDocTemplate.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。