當前位置: 首頁>>代碼示例>>Python>>正文


Python Flowable.__init__方法代碼示例

本文整理匯總了Python中reportlab.platypus.Flowable.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python Flowable.__init__方法的具體用法?Python Flowable.__init__怎麽用?Python Flowable.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在reportlab.platypus.Flowable的用法示例。


在下文中一共展示了Flowable.__init__方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from reportlab.platypus import Flowable [as 別名]
# 或者: from reportlab.platypus.Flowable import __init__ [as 別名]
 def __init__(self, width, height, caption="",
              captionFont=_baseFontNameI, captionSize=12,
              background=None,
              captionTextColor=toColor('black'),
              captionBackColor=None,
              border=None,
              spaceBefore=12,
              spaceAfter=12,
              captionGap=None,
              captionAlign='centre',
              captionPosition='bottom',
              hAlign='CENTER',
              ):
     Flowable.__init__(self)
     self.width = width
     self.figureHeight = height
     self.caption = caption
     self.captionFont = captionFont
     self.captionSize = captionSize
     self.captionTextColor = captionTextColor
     self.captionBackColor = captionBackColor
     self.captionGap = captionGap or 0.5*captionSize
     self.captionAlign = captionAlign
     self.captionPosition = captionPosition
     self._captionData = None
     self.captionHeight = 0  # work out later
     self.background = background
     self.border = border
     self.spaceBefore = spaceBefore
     self.spaceAfter = spaceAfter
     self.hAlign=hAlign
     self._getCaptionPara()  #Larry Meyn's fix - otherwise they all get the number of the last chapter.
開發者ID:AlonsoAyelen,項目名稱:Voluntariado_veterinaria,代碼行數:34,代碼來源:figures.py

示例2: __init__

# 需要導入模塊: from reportlab.platypus import Flowable [as 別名]
# 或者: from reportlab.platypus.Flowable import __init__ [as 別名]
 def __init__(self, measure_unit, document):
     Flowable.__init__(self)
     self.unit = measure_unit
     self.cursor = Cursor()
     self._elements = []
     self.canv = document.canv
     self._frame = document.pageTemplate.frames[0]
開發者ID:affinitic,項目名稱:affinitic.pdf,代碼行數:9,代碼來源:flowable.py

示例3: __init__

# 需要導入模塊: from reportlab.platypus import Flowable [as 別名]
# 或者: from reportlab.platypus.Flowable import __init__ [as 別名]
    def __init__(self, width, height, images, preserve_aspect_ratio=True):
        """ Initialize the 'TriPlanar' class.

        If a None image is passed, an empty box will be displayed.

        Parameters
        ----------
        width: float (mandatory)
            the element width.
        heights: float (mandatory)
            the element height.
        images: 4-uplet or 1-uplet (mandatory)
            the path to the images to be displayed. If a 4-uplet is specified
            the display order is (image_upper_left, image_upper_right,
            image_bottom_left, image_bottom_right)
        preserve_aspect_ratio: bool (optional, default True)
            if True preserve the image aspect ratios.
        """
        Flowable.__init__(self)
        self.width = width
        self.height = height
        self.display_mode = "multi"
        if len(images) == 1:
            self.display_mode = "single"
        self.images = images
        self.preserve_aspect_ratio = preserve_aspect_ratio
        self.missing_file = os.path.join(os.path.dirname(__file__),
                                         "resources", "missing.png")
開發者ID:neurospin,項目名稱:pyconnectomist,代碼行數:30,代碼來源:pdftools.py

示例4: __init__

# 需要導入模塊: from reportlab.platypus import Flowable [as 別名]
# 或者: from reportlab.platypus.Flowable import __init__ [as 別名]
    def __init__(self,
                 resource,
                 item,
                 labels=None,
                 common=None,
                 backside=False,
                 multiple=False,
                 ):
        """
            Constructor

            @param resource: the resource
            @param item: the data item
            @param labels: the field labels
            @param common: common data for all cards
            @param backside: this instance should render a card backside
            @param multiple: there are multiple cards per page
        """

        Flowable.__init__(self)

        self.width, self.height = self.cardsize

        self.resource = resource
        self.item = item

        self.labels = labels if labels is not None else {}
        self.common = common if common is not None else {}

        self.backside = backside
        self.multiple = multiple
開發者ID:flavour,項目名稱:aidiq,代碼行數:33,代碼來源:card.py

示例5: __init__

# 需要導入模塊: from reportlab.platypus import Flowable [as 別名]
# 或者: from reportlab.platypus.Flowable import __init__ [as 別名]
 def __init__(self, width, height, caption="",
              captionFont="Times-Italic", captionSize=12,
              background=None,
              captionTextColor=toColor('black'),
              captionBackColor=None,
              border=1,
              spaceBefore=12,
              spaceAfter=12,
              captionGap=None,
              ):
     Flowable.__init__(self)
     self.width = width
     self.figureHeight = height
     self.caption = caption
     self.captionFont = captionFont
     self.captionSize = captionSize
     self.captionTextColor = captionTextColor
     self.captionBackColor = captionBackColor
     self.captionGap = captionGap
     self._captionData = None
     self.captionHeight = 0  # work out later
     self.background = background
     self.border = border
     self.spaceBefore = spaceBefore
     self.spaceAfter = spaceAfter
開發者ID:jwheare,項目名稱:digest,代碼行數:27,代碼來源:figures.py

示例6: __init__

# 需要導入模塊: from reportlab.platypus import Flowable [as 別名]
# 或者: from reportlab.platypus.Flowable import __init__ [as 別名]
 def __init__(self, svg, width=None, height=None, kind='direct'):
     # svg is either a text buffer with svg or a xml node object.
     Flowable.__init__(self)
     self._kind = kind
     s = svglib.SvgRenderer()
     if isinstance(svg, (str, unicode)):
         doc = xml.dom.minidom.parseString(svg)
         svg = doc.documentElement
     s.render(svg)
     self.doc = s.finish()
     #self.doc = svglib.svg2rlg(filename)
     self.imageWidth = width
     self.imageHeight = height
     x1, y1, x2, y2 = self.doc.getBounds()
     self._w, self._h = x2, y2
     if not self.imageWidth:
         self.imageWidth = self._w
     if not self.imageHeight:
         self.imageHeight = self._h
     self.__ratio = float(self.imageWidth)/self.imageHeight
     if kind in ['direct','absolute']:
         self.drawWidth = width or self.imageWidth
         self.drawHeight = height or self.imageHeight
     elif kind in ['bound','proportional']:
         factor = min(float(width)/self.imageWidth,float(height)/self.imageHeight)
         self.drawWidth = self.imageWidth*factor
         self.drawHeight = self.imageHeight*factor
開發者ID:aytsai,項目名稱:ricebowl,代碼行數:29,代碼來源:svgimage.py

示例7: __init__

# 需要導入模塊: from reportlab.platypus import Flowable [as 別名]
# 或者: from reportlab.platypus.Flowable import __init__ [as 別名]
    def __init__(self, width, height, caption="",
                 captionFont="Times-Italic", captionSize=12,
                 background=None,
                 captionTextColor=toColor('black'),
                 captionBackColor=None,
                 border=1,
                 spaceBefore=12,
                 spaceAfter=12,
                 captionGap=None,
                 ):
        Flowable.__init__(self)
        self.width = width
        self.figureHeight = height
        self.caption = caption
        self.captionFont = captionFont
        self.captionSize = captionSize
        self.captionTextColor = captionTextColor
        self.captionBackColor = captionBackColor
        self.captionGap = captionGap
        self._captionData = None
        self.captionHeight = 0  # work out later
        self.background = background
        self.border = border
        self.spaceBefore = spaceBefore
        self.spaceAfter = spaceAfter

        self._getCaptionPara()  #Larry Meyn's fix - otherwise they all get the number of the last chapter.
開發者ID:AceZOfZSpades,項目名稱:RankPanda,代碼行數:29,代碼來源:figures.py

示例8: __init__

# 需要導入模塊: from reportlab.platypus import Flowable [as 別名]
# 或者: from reportlab.platypus.Flowable import __init__ [as 別名]
 def __init__(self, filename, width=None, height=None, kind='direct',
                                  mask=None, lazy=True, srcinfo=None):
     Flowable.__init__(self)
     ext = os.path.splitext(filename)[-1]
     self._kind = kind
     # Prefer svg2rlg for SVG, as it works better
     if LazyImports.svg2rlg:
         self._mode = 'svg2rlg'
         self.doc = LazyImports.svg2rlg.svg2rlg(filename)
         self.imageWidth = width
         self.imageHeight = height
         x1, y1, x2, y2 = self.doc.getBounds()
         # Actually, svg2rlg's getBounds seems broken.
         self._w, self._h = x2, y2
         if not self.imageWidth:
             self.imageWidth = self._w
         if not self.imageHeight:
             self.imageHeight = self._h
     else:
         self._mode = None
         log.error("SVG support not enabled,"
             " please install svg2rlg.")
     self.__ratio = float(self.imageWidth)/self.imageHeight
     if kind in ['direct','absolute']:
         self.drawWidth = width or self.imageWidth
         self.drawHeight = height or self.imageHeight
     elif kind in ['bound','proportional']:
         factor = min(float(width)/self.imageWidth,float(height)/self.imageHeight)
         self.drawWidth = self.imageWidth*factor
         self.drawHeight = self.imageHeight*factor
開發者ID:EronHennessey,項目名稱:rst2pdf,代碼行數:32,代碼來源:svgimage.py

示例9: __init__

# 需要導入模塊: from reportlab.platypus import Flowable [as 別名]
# 或者: from reportlab.platypus.Flowable import __init__ [as 別名]
 def __init__(self, filename, width=None, height=None, kind='direct',
              mask=None, lazy=True, srcinfo=None):
     Flowable.__init__(self)
     self._kind = kind
     self._mode = 'svg2rlg'
     self.doc = svg2rlg(filename)
     self.imageWidth = width
     self.imageHeight = height
     x1, y1, x2, y2 = self.doc.getBounds()
     # Actually, svg2rlg's getBounds seems broken.
     self._w, self._h = x2, y2
     if not self.imageWidth:
         self.imageWidth = self._w
     if not self.imageHeight:
         self.imageHeight = self._h
     self.__ratio = float(self.imageWidth) / self.imageHeight
     if kind in ['direct', 'absolute']:
         self.drawWidth = width or self.imageWidth
         self.drawHeight = height or self.imageHeight
     elif kind in ['bound', 'proportional']:
         factor = min(
             float(width) / self.imageWidth,
             float(height) / self.imageHeight
         )
         self.drawWidth = self.imageWidth * factor
         self.drawHeight = self.imageHeight * factor
開發者ID:aquavitae,項目名稱:rst2pdf-py3-dev,代碼行數:28,代碼來源:svgimage.py

示例10: __init__

# 需要導入模塊: from reportlab.platypus import Flowable [as 別名]
# 或者: from reportlab.platypus.Flowable import __init__ [as 別名]
 def __init__(self, texto="", x=0, y=0, width=200, height=10):
     Flowable.__init__(self)
     self.x      = x
     self.y      = y
     self.width  = width
     self.height = height
     self.texto  = texto
     self.styles = getSampleStyleSheet()
開發者ID:flaviomicheletti,項目名稱:flask-collection,代碼行數:10,代碼來源:passo_040.py

示例11: __init__

# 需要導入模塊: from reportlab.platypus import Flowable [as 別名]
# 或者: from reportlab.platypus.Flowable import __init__ [as 別名]
 def __init__(self, fname, width, height):
     Flowable.__init__(self)
     self.fname = fname
     self.width = width 
     self.height = height
     self.x = 0
     self.y = 0
     self.page = 0
開發者ID:dolvany,項目名稱:dtrace-stap-book,代碼行數:10,代碼來源:pdf.py

示例12: __init__

# 需要導入模塊: from reportlab.platypus import Flowable [as 別名]
# 或者: from reportlab.platypus.Flowable import __init__ [as 別名]
 def __init__(self, x=0, y=-15, width=100, height=15, text=""):
     Flowable.__init__(self)
     self.x = x
     self.y = y
     self.width = width
     self.height = height
     self.text = text
     self.styles = getSampleStyleSheet()
開發者ID:rsheil,項目名稱:dnpworkup,代碼行數:10,代碼來源:dnp_rs.py

示例13: __init__

# 需要導入模塊: from reportlab.platypus import Flowable [as 別名]
# 或者: from reportlab.platypus.Flowable import __init__ [as 別名]
 def __init__(self, doctor):
     Flowable.__init__(self)
     self.user = doctor.refer_userprofile.user
     self.adr = doctor.address
     self.x = 0
     self.y = 25
     self.width = 250
     self.height = 15
     self.styles = getSampleStyleSheet()
開發者ID:Foxugly,項目名稱:medagenda,代碼行數:11,代碼來源:invoice.py

示例14: __init__

# 需要導入模塊: from reportlab.platypus import Flowable [as 別名]
# 或者: from reportlab.platypus.Flowable import __init__ [as 別名]
 def __init__(self, fator=None, style=None, imagem=None, x=0, y=0, width=defaultPageSize[0] - (2 * cm), height=55):
     Flowable.__init__(self)
     self.x      = x
     self.y      = y
     self.width  = width
     self.height = height
     self.fator  = fator
     self.style = style
     self.imagem = imagem
開發者ID:flaviomicheletti,項目名稱:flask-collection,代碼行數:11,代碼來源:laudo_007.py

示例15: __init__

# 需要導入模塊: from reportlab.platypus import Flowable [as 別名]
# 或者: from reportlab.platypus.Flowable import __init__ [as 別名]
 def __init__(self, x=0, y=-15, width=40, height=15, text_label="", text_box=""):
     Flowable.__init__(self)
     self.x = x
     self.y = y
     self.width = width
     self.height = height
     self.text_box = text_box
     self.text_label = text_label
     self.styles = getSampleStyleSheet()
     self.styles.add(ParagraphStyle(name='HeadText', fontName='OpenSans-Regular', fontSize=10))
開發者ID:mimischi,項目名稱:django-clock,代碼行數:12,代碼來源:printing.py


注:本文中的reportlab.platypus.Flowable.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。