bec_lib.pdf_writer.BECPDF#
- class BECPDF(orientation='P', unit='mm', format='A4')[source]#
Bases:
FPDF
Custom PDF class for BEC.
Methods
Accept automatic page break or not
Add a TrueType or Type1 font
Create a new internal link
Start a new page
Define an alias for total number of pages
Output a cell
Decorator to protect drawing methods
Terminate document
Barcode 3of9
Draw a dashed line.
Draw a ellipse
Fatal error
Footer to be implemented in your own inherited class
Get width of a string in the current font
Get x position
Get y position
Header to be implemented in your own inherited class
Put an image on the page
Barcode I2of5 (numeric), adds a 0 if odd lenght
Draw a line
Put a link on the page
Line Feed; default value is last cell height
Output text with automatic or explicit line breaks
Check that text input is in the correct format/encoding
Begin document
Output PDF to some destination
Get current page number
Draw a rectangle
rotate
Author of document
Set auto page break mode and triggering margin
Set page compression
Creator of document
Set display mode in viewer
Set color for all stroking operations
Set color for all filling operations
Select a font; size given in points
Set font size in points
Keywords of document
Set left margin
Set line width
Set destination of internal link
Set left, top and right margins
Set right margin
Subject of document
Set color for text
Title of document
Set top margin
Set x position
Set x and y positions
Set y position and reset x
Output a string
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
- add_link()#
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 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
- 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
- link(x, y, w, h, link)#
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_link(link, y=0, page=-1)#
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