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


Python Flowable.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from reportlab.platypus.flowables import Flowable [as 别名]
# 或者: from reportlab.platypus.flowables.Flowable import __init__ [as 别名]
 def __init__(self, master, margin=10):
     Flowable.__init__(self)
     self.master = master
     self.margin = 10
     if master.medical_technologist or master.pathologist:
         self.has_data = True
     else:
         self.has_data = False
开发者ID:HCCB,项目名称:janus,代码行数:10,代码来源:reports.py

示例2: __init__

# 需要导入模块: from reportlab.platypus.flowables import Flowable [as 别名]
# 或者: from reportlab.platypus.flowables.Flowable import __init__ [as 别名]
 def __init__(self, maxWidth, content=[], style=None, mode=None, scale=None):
     self.maxWidth = maxWidth
     self.content = content
     self.style = style
     self.mode = mode
     self.pad = None
     self.scale = scale
     Flowable.__init__(self)
开发者ID:aquavitae,项目名称:rst2pdf-py3-dev,代码行数:10,代码来源:flowables.py

示例3: __init__

# 需要导入模块: from reportlab.platypus.flowables import Flowable [as 别名]
# 或者: from reportlab.platypus.flowables.Flowable import __init__ [as 别名]
    def __init__(self, component=None, bounds=None,
                 fixed_scale=None, hAlign='CENTER'):
        self.fixed_scale = fixed_scale
        self.component = component
        if bounds is None:
            bounds = (500, 500)

        self.component.outer_bounds = bounds
        self.component.do_layout(force=True)
        Flowable.__init__(self)
        if hAlign:
            self.hAlign = hAlign
开发者ID:UManPychron,项目名称:pychron,代码行数:14,代码来源:component_flowable.py

示例4: __init__

# 需要导入模块: from reportlab.platypus.flowables import Flowable [as 别名]
# 或者: from reportlab.platypus.flowables.Flowable import __init__ [as 别名]
 def __init__(self, filename, width=None, height=None, kind='bound',
                                  mask=None, lazy=True, srcinfo=None):
     Flowable.__init__(self)
     self._kind = kind
     page = PdfReader(filename, decompress=False).pages[0]
     self.xobj = pagexobj(page)
     self.imageWidth, self.imageHeight = imageWidth, imageHeight = self.xobj.w, self.xobj.h
     width = width or imageWidth
     height = height or imageHeight
     if kind in ['bound','proportional']:
         factor = min(float(width)/imageWidth,float(height)/imageHeight)
         width = factor * imageWidth
         height = factor * imageHeight
     self.drawWidth = width
     self.drawHeight = height
开发者ID:oledm,项目名称:gmp,代码行数:17,代码来源:helpers.py

示例5: __init__

# 需要导入模块: from reportlab.platypus.flowables import Flowable [as 别名]
# 或者: from reportlab.platypus.flowables.Flowable import __init__ [as 别名]
 def __init__(self, width, height, number=None, font=None, size=None, align="left"):
     Flowable.__init__(self)
     self.width = width
     self.height = height
     self.number = number
     
     if not font:
         font = "Helvetica"
         
     if not size:
         size = 8
     
     self.size = size
     self.font = font
     self.align = align
开发者ID:jjmojojjmojo,项目名称:jira-autoprint,代码行数:17,代码来源:util.py

示例6: __init__

# 需要导入模块: from reportlab.platypus.flowables import Flowable [as 别名]
# 或者: from reportlab.platypus.flowables.Flowable import __init__ [as 别名]
	def __init__(self,string,font_name,font_size,color=HexColor('#FFFFFF'),color_space = 'RGB',x0=0,y0=0,border=False):
		Flowable.__init__(self)

		self.stroke_width = 0.1
		self.border = border
		self.border_width = 2
		self.border_color = HexColor('#FFFFFF')
		self.interline = 0.5*mm

		self.text = string
		#print self.text
		self.text_font = font_name
		self.text_font_size = font_size
		self.color = color

		self.content_width = utils.text.size.width(self.text,self.text_font,self.text_font_size)
		self.content_height = len(self.text.split('<br/>'))*self.text_font_size + (len(self.text.split('<br/>')) -1)*self.interline
开发者ID:raven-oscar,项目名称:layout_tool,代码行数:19,代码来源:text_string.py

示例7: __init__

# 需要导入模块: from reportlab.platypus.flowables import Flowable [as 别名]
# 或者: from reportlab.platypus.flowables.Flowable import __init__ [as 别名]
    def __init__(self, text, style, debug=False, splitted=False, **kwDict):

        Flowable.__init__(self)

        self.text = text
        self.text.calc()
        self.style = style
        self.text.style = style

        self.debug = debug
        self.splitted = splitted

        # More attributes
        for k, v in six.iteritems(kwDict):
            setattr(self, k, v)

        # set later...
        self.splitIndex = None
开发者ID:Krukov,项目名称:xhtml2pdf,代码行数:20,代码来源:paragraph.py

示例8: __init__

# 需要导入模块: from reportlab.platypus.flowables import Flowable [as 别名]
# 或者: from reportlab.platypus.flowables.Flowable import __init__ [as 别名]
    def __init__(self, node, styles, value, encoding):
        Flowable.__init__(self)

        self.node = node
        self.styles = styles
        self.value = value
        self.encoding = encoding
        self.xpos = utils.unit_get(node.getAttribute('x'))
        self.ypos = utils.unit_get(node.getAttribute('y'))
        self.width = utils.unit_get(node.getAttribute('width'))
        self.height = utils.unit_get(node.getAttribute('height'))
        self.code_name = node.getAttribute('code')
        self.codes = getCodes()

        from trml2pdf.parser import ParserError
        try:
            self.codes[self.code_name]
        except KeyError, msg:
            raise ParserError("Unknown barcode name '%s'." % self.code_name)
开发者ID:eduardocereto,项目名称:trml2pdf,代码行数:21,代码来源:barcode.py

示例9: __init__

# 需要导入模块: from reportlab.platypus.flowables import Flowable [as 别名]
# 或者: from reportlab.platypus.flowables.Flowable import __init__ [as 别名]
 def __init__(self, formName, orientation=None,iptrans=None, callback=None,
         pdf_data=None, user_data=None,
         pdfBoxType=None,
         autoCrop=None,
         pageSize=None,
         pageSizeHandler=None,
         ):
     Flowable.__init__(self)
     self.formName = formName
     self._orientation = orientation
     self._iptrans = iptrans
     self._pdfBoxType = pdfBoxType
     self._autoCrop = autoCrop
     self._pageSize = pageSize
     self._pageSizeHandler = pageSizeHandler
     self._pdf_data = pdf_data
     if callback:
         self.callback = lambda key,canv: callback(key,canv,self,pdf_data,user_data)
     else:
         self.callback = lambda key,canv: None
开发者ID:AndyKovv,项目名称:hostel,代码行数:22,代码来源:pageflow.py

示例10: __init__

# 需要导入模块: from reportlab.platypus.flowables import Flowable [as 别名]
# 或者: from reportlab.platypus.flowables.Flowable import __init__ [as 别名]
    def __init__(self, library, width, height, data, scale=1, type='datamatrix', align='left'):
        '''
        Creates a Barcode Flowable

        * width and height define the size in ReportLab points (for example 2*cm x 2*cm)
        * data will be encoded as the barcode
        * scale allows you to resize the barcode (default 1)
        * type is the type of the barcode (default 'datamatrix').
          Other types can be found in media/common/pdf_img/barcode.ps
        '''

        Flowable.__init__(self)

        self.width = width
        self.height = height
        self.scale = scale
        self.data = data
        self.resolution_factor = 8
        self.type = type
        self.hAlign = 'CENTER'
        self.library = library
        self.align = align
开发者ID:mvpoland,项目名称:django-pdfgen,代码行数:24,代码来源:barcode.py

示例11: __init__

# 需要导入模块: from reportlab.platypus.flowables import Flowable [as 别名]
# 或者: from reportlab.platypus.flowables.Flowable import __init__ [as 别名]
    def __init__(self, story, height=None, width=None, pos_x=None, pos_y=None,
                 frame_attrs=freeze({}), attributes=freeze({}), pto_trailer=None,
                 pto_header=None):
        Flowable.__init__(self)
        # get on story
        self.div_story = story
        # set frame style
        self.frame_attrs = {'leftPadding': 0, 'bottomPadding': 0,
                           'rightPadding': 0, 'topPadding': 0,
                           'showBoundary': 0}
        # PTO initialisation
        self.pto_trailer = pto_trailer
        self.pto_header = pto_header

        if frame_attrs is not None:
            self.frame_attrs.update(frame_attrs)

        for margin in ('topMargin', 'bottomMargin', 'leftMargin',
                       'rightMargin'):
            if margin in self.frame_attrs:
                del self.frame_attrs[margin]

        border = self.frame_attrs['showBoundary']
        if isinstance(border, ShowBoundaryValue):
            border = border.width
        if border:
            for padding_attr in FRAME_PADDINGS_KEYS:
                self.frame_attrs[padding_attr] += border
        self.frame_width = width

        # Overflow
        # TODO to improve
        self.keep_in_frame = None
        style = attribute_style_to_dict(attributes.get((None, 'style'), ''))
        self.overflow = style.get('overflow-y', None)
        if self.overflow == 'hidden':
            self.overflow = 'truncate'
        else:
            self.overflow = None
开发者ID:kennym,项目名称:itools,代码行数:41,代码来源:flowables.py

示例12: __init__

# 需要导入模块: from reportlab.platypus.flowables import Flowable [as 别名]
# 或者: from reportlab.platypus.flowables.Flowable import __init__ [as 别名]
 def __init__(self, barCodeSymbol):
    Flowable.__init__(self)
    assert hasattr(barCodeSymbol,'font')
    "name of font to use for printing human-readable text"
    
    assert hasattr(barCodeSymbol,'bits')
    
    """string of 0,1 and L characters. each character stands for one
    "bit" or "module". 0 means white, 1 means black, L means long
    black"""
    
    
    assert hasattr(barCodeSymbol,'moduleHeight')
    "module height in points"
    assert hasattr(barCodeSymbol,'patternWidth')
    "width in inch"
    
    self.lightMargin = 9 * barCodeSymbol.moduleWidth * inch
    self.barCodeSymbol = barCodeSymbol
    self.width = self.barCodeSymbol.patternWidth * inch \
                 + self.lightMargin * 2
    self.height = self.barCodeSymbol.moduleHeight * inch
开发者ID:BackupTheBerlios,项目名称:lino-svn,代码行数:24,代码来源:barcodes.py

示例13: __init__

# 需要导入模块: from reportlab.platypus.flowables import Flowable [as 别名]
# 或者: from reportlab.platypus.flowables.Flowable import __init__ [as 别名]
	def __init__(self,price_rub,price_kop,items=1,scale=1,x0=0,y0=0):
		Flowable.__init__(self)
		self.scale = scale
		self.price_rub = price_rub
		self.price_kop = price_kop
		self.items = str(items) + '.шт'
		
		self.rub_font = 'HelveticaNeue-BoldCr'
		self.rub_font_size = 28*scale
		self.rub_width = utils.text.size.width(self.price_rub,self.rub_font,self.rub_font_size)

		self.kop_font = 'HelveticaNeue-BoldCr'
		self.kop_font_size = 15*scale
		self.kop_width = utils.text.size.width(self.price_kop,self.kop_font,self.kop_font_size)

		self.splitter_font = 'HelveticaNeue-BoldCr'
		self.splitter_font_size = 28*scale
		self.y_splitter = 4
		
		self.items_font = 'HelveticaNeue_LT_CYR_57_Cond'
		self.items_font_size = 5*scale
		self.items_width = utils.text.size.width(self.items,self.items_font,self.items_font_size)

		self.y_items = 4
		self.x0 = x0
		self.y0 = y0
		self.y0_kop = 10		
		self.stroke_width = 2
		self.scale = scale	

		self.content_width = self.rub_width + max([self.kop_width,self.items_width]) + 5*mm
		self.content_height = self.rub_font_size = 28*scale + 2*mm

		self.body_color = HexColor('#CE1527')
		self.body_color = HexColor('#204A87')
		self.line_color = HexColor('#FFFFFF') 
开发者ID:raven-oscar,项目名称:layout_tool,代码行数:38,代码来源:price_std.py

示例14: __init__

# 需要导入模块: from reportlab.platypus.flowables import Flowable [as 别名]
# 或者: from reportlab.platypus.flowables.Flowable import __init__ [as 别名]
 def __init__(self, txt, lvl):
     Flowable.__init__(self)
     self.txt = txt
     self.lvl = lvl
开发者ID:ingob,项目名称:mwlib.rl,代码行数:6,代码来源:customflowables.py

示例15: __init__

# 需要导入模块: from reportlab.platypus.flowables import Flowable [as 别名]
# 或者: from reportlab.platypus.flowables.Flowable import __init__ [as 别名]
	def __init__(self,width,height,color):
		Flowable.__init__(self)
		self.width = width*mm
		self.height = height*mm
		self.color = HexColor(color)
开发者ID:raven-oscar,项目名称:layout_tool,代码行数:7,代码来源:rectangle.py


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