How to use the xhtml2pdf.paragraph2.BoxBegin function in xhtml2pdf

To help you get started, we’ve selected a few xhtml2pdf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xhtml2pdf / xhtml2pdf / xhtml2pdf / paragraph2.py View on Github external
# Start with indent in first line of text
        if not splitted:
            x = style["textIndent"]

        # Loop for each line
        while True:

            # Reset values for new line
            posBegin = self.pos
            line = Line(style)

            # Update boxes for next line
            for box in copy.deepcopy(boxStack):
                box["x"] = 0
                line.append(BoxBegin(box))

            # Loop for collecting line elements
            while True:

                # Get next group of unbreakable elements
                self.groupPos = self.pos
                groupWidth, br, group = self.getGroup()

                # No more groups? Leave line
                if not group:
                    break

                # To we fit the line? Reset cursor and finish line
                if groupWidth + x > maxWidth:
                    self.pos = self.groupPos
                    break
github xhtml2pdf / xhtml2pdf / xhtml2pdf / paragraph2.py View on Github external
fontSize=fs),
            Word(
                text="Lorem",
                fontName=fn,
                fontSize=fs),
            Space(
                fontName=fn,
                fontSize=fs),
            Word(
                text="Lorem",
                fontName=fn,
                fontSize=fs),
            Space(
                fontName=fn,
                fontSize=fs),
            BoxBegin(
                fontName=fn,
                fontSize=fs,
                backgroundColor=Color(1, 1, 0),
                **makeBorder(1, "solid", Color(1, 0, 0))),
            Word(
                text="Lorem",
                fontName=fn,
                fontSize=fs),
            BoxEnd(),
            Space(
                fontName=fn,
                fontSize=fs),
            Word(
                text="Lorem",
                fontName=fn,
                fontSize=fs),
github xhtml2pdf / xhtml2pdf / xhtml2pdf / paragraph2.py View on Github external
BoxEnd(),
            Space(
                fontName=fn,
                fontSize=fs),
            Word(
                text="jItalic",
                fontName="Times-Italic",
                fontSize=fs),
            Space(
                fontName=fn,
                fontSize=fs),

            # <span style="border: 1px solid red;">ipsum <span style="border: 1px solid green; padding: 4px; padding-left: 20px; background: yellow; margin-bottom: 8px; margin-left: 10px;">
            # Lo<font size="12pt">re</font>m</span> <span style="background:blue; height: 30px;">ipsum</span> Lorem</span>

            BoxBegin(
                fontName=fn,
                fontSize=fs,
                **makeBorder(0.5, "solid", Color(0, 1, 0))),
            Word(
                text="Lorem",
                fontName="Times-Bold",
                fontSize=fs),
            Word(
                text="Lorem",
                fontName=fn,
                fontSize=fs),
            Word(
                text="Lorem",
                fontName=fn,
                fontSize=fs),
            Word(
github xhtml2pdf / xhtml2pdf / xhtml2pdf / paragraph2.py View on Github external
text="TrennbarTrennbar",
                pairs=[("Trenn-", "barTrennbar")],
                fontName=fn,
                fontSize=fs),
            Space(
                fontName=fn,
                fontSize=fs),
            Word(
                text="Normal",
                color=Color(1, 0, 0),
                fontName=fn,
                fontSize=fs),
            Space(
                fontName=fn,
                fontSize=fs),
            BoxBegin(
                fontName=fn,
                fontSize=fs,
                underline=True,
                strike=True),
            Word(
                text="gGrößer",
                fontName=fn,
                fontSize=fs * 1.5),
            Space(
                fontName=fn,
                fontSize=fs),
            Word(
                text="Bold",
                fontName="Times-Bold",
                fontSize=fs),
            BoxEnd(),