Label

class pdfpug.modules.Label(**kwargs)

Label are useful for depicting classification categories and are analogous to tags. A group of labels are by default displayed horizontally. They can be customized in various colors and types.

>>> from pdfpug.modules.Label
>>> from pdfpug.common import Color, LabelType
>>> category = Label(text='Documentation', color=Color.blue)
>>> tag = Label(text="v1.0", label_type=LabelType.tag)
../_images/labels.png

Note

Do not mistake a Label element for UI labels that display paragraphs of text! That use case is covered by Paragraph element.

Parameters:
  • text (Optional[str]) – content
  • subtext (Optional[str]) – content detail
  • color (Optional[Color]) – background color
  • size (Optional[Size]) – size of label
  • label_type (Optional[LabelType]) – label type
class pdfpug.common.LabelType

Enum Label types

tag = 'tag'

Label looks like a shopping tag

basic = 'basic'

Minimalistic label with just an outline

circular = 'circular'

Circular shaped label