bec_lib.pdf_writer.BECPDF#

class BECPDF(orientation='P', unit='mm', format='A4')[source]#

Bases: FPDF

Custom PDF class for BEC.

Methods

accept_page_break

Accept automatic page break or not

add_font

Add a TrueType or Type1 font

add_link

Create a new internal link

add_page

Start a new page

alias_nb_pages

Define an alias for total number of pages

cell

Output a cell

check_page

Decorator to protect drawing methods

close

Terminate document

code39

Barcode 3of9

dashed_line

Draw a dashed line.

ellipse

Draw a ellipse

error

Fatal error

footer

Footer to be implemented in your own inherited class

get_string_width

Get width of a string in the current font

get_x

Get x position

get_y

Get y position

header

Header to be implemented in your own inherited class

image

Put an image on the page

interleaved2of5

Barcode I2of5 (numeric), adds a 0 if odd lenght

line

Draw a line

link

Put a link on the page

ln

Line Feed; default value is last cell height

multi_cell

Output text with automatic or explicit line breaks

normalize_text

Check that text input is in the correct format/encoding

open

Begin document

output

Output PDF to some destination

page_no

Get current page number

rect

Draw a rectangle

rotate

set_author

Author of document

set_auto_page_break

Set auto page break mode and triggering margin

set_compression

Set page compression

set_creator

Creator of document

set_display_mode

Set display mode in viewer

set_draw_color

Set color for all stroking operations

set_fill_color

Set color for all filling operations

set_font

Select a font; size given in points

set_font_size

Set font size in points

set_keywords

Keywords of document

set_left_margin

Set left margin

set_line_width

Set line width

set_link

Set destination of internal link

set_margins

Set left, top and right margins

set_right_margin

Set right margin

set_subject

Subject of document

set_text_color

Set color for text

set_title

Title of document

set_top_margin

Set top margin

set_x

Set x position

set_xy

Set x and y positions

set_y

Set y position and reset x

text

Output a string

write

Output text in flowing mode

accept_page_break()#

Accept automatic page break or not

add_font(family, style='', fname='', uni=False)#

Add a TrueType or Type1 font

Create a new internal link

add_page(orientation='')#

Start a new page

alias_nb_pages(alias='{nb}')#

Define an alias for total number of pages

cell(w, h=0, txt='', border=0, ln=0, align='', fill=0, link='')#

Output a cell

check_page()#

Decorator to protect drawing methods

close()#

Terminate document

code39(txt, x, y, w=1.5, h=5.0)#

Barcode 3of9

dashed_line(x1, y1, x2, y2, dash_length=1, space_length=1)#

Draw a dashed line. Same interface as line() except: - dash_length: Length of the dash - space_length: Length of the space between dashes

ellipse(x, y, w, h, style='')#

Draw a ellipse

error(msg)#

Fatal error

footer()[source]#

Footer to be implemented in your own inherited class

get_string_width(s)#

Get width of a string in the current font

get_x()#

Get x position

get_y()#

Get y position

header()[source]#

Header to be implemented in your own inherited class

image(name, x=None, y=None, w=0, h=0, type='', link='')#

Put an image on the page

interleaved2of5(txt, x, y, w=1.0, h=10.0)#

Barcode I2of5 (numeric), adds a 0 if odd lenght

line(x1, y1, x2, y2)#

Draw a line

Put a link on the page

ln(h='')#

Line Feed; default value is last cell height

multi_cell(w, h, txt='', border=0, align='J', fill=0, split_only=False)#

Output text with automatic or explicit line breaks

normalize_text(txt)#

Check that text input is in the correct format/encoding

open()#

Begin document

output(name='', dest='')#

Output PDF to some destination

page_no()#

Get current page number

rect(x, y, w, h, style='')#

Draw a rectangle

set_author(author)#

Author of document

set_auto_page_break(auto, margin=0)#

Set auto page break mode and triggering margin

set_compression(compress)#

Set page compression

set_creator(creator)#

Creator of document

set_display_mode(zoom, layout='continuous')#

Set display mode in viewer

The “zoom” argument may be ‘fullpage’, ‘fullwidth’, ‘real’, ‘default’, or a number, interpreted as a percentage.

set_draw_color(r, g=-1, b=-1)#

Set color for all stroking operations

set_fill_color(r, g=-1, b=-1)#

Set color for all filling operations

set_font(family, style='', size=0)#

Select a font; size given in points

set_font_size(size)#

Set font size in points

set_keywords(keywords)#

Keywords of document

set_left_margin(margin)#

Set left margin

set_line_width(width)#

Set line width

Set destination of internal link

set_margins(left, top, right=-1)#

Set left, top and right margins

set_right_margin(margin)#

Set right margin

set_subject(subject)#

Subject of document

set_text_color(r, g=-1, b=-1)#

Set color for text

set_title(title)#

Title of document

set_top_margin(margin)#

Set top margin

set_x(x)#

Set x position

set_xy(x, y)#

Set x and y positions

set_y(y)#

Set y position and reset x

text(x, y, txt='')#

Output a string

write(h, txt='', link='')#

Output text in flowing mode