Bases: lpod.element.odf_element
Get how the frame is attached to its environment.
Return: ‘page’, ‘frame’, ‘paragraph’, ‘char’ or ‘as-char’
Get the number of the page where the frame is attached when the anchor type is ‘page’.
Return: int
Get the position of the frame relative to its anchor point.
Position is a (left, top) tuple with items including the unit, e.g. (‘10cm’, ‘15cm’).
Return: (str, str)
Get the size of the frame.
Size is a (width, height) tuple with items including the unit, e.g. (‘10cm’, ‘15cm’).
Return: (str, str)
Set how the frame is attached to its environment.
When the type is ‘page’, you can give the number of the page where to attach.
Arguments:
anchor_type – ‘page’, ‘frame’, ‘paragraph’, ‘char’ or ‘as-char’
page_number – int (when anchor_type == ‘page’)
Set the number of the page where the frame is attached when the anchor type is ‘page’, or None to delete it
Arguments:
page_number – int or None
Set the position of the frame relative to its anchor point.
Position is a (left, top) tuple with items including the unit, e.g. (‘10cm’, ‘15cm’).
Arguments:
position – (str, str)
Set the size of the frame.
Size is a (width, height) tuple with items including the unit, e.g. (‘10cm’, ‘15cm’). The dimensions can be None.
Arguments:
size – (str, str)
Create a frame element of the given size. If positioned by page, give the page number and the x, y position.
Size is a (width, height) tuple and position is a (left, top) tuple; items are strings including the unit, e.g. (‘10cm’, ‘15cm’).
Frames are not useful by themselves. You should consider calling odf_create_image_frame or odf_create_text_frame directly.
Arguments:
name – unicode
size – (str, str)
- anchor_type – ‘page’, ‘frame’, ‘paragraph’ (default), ‘char’
- or ‘as-char’
page_number – int (when anchor_type == ‘page’)
position – (str, str)
style – unicode
Return: odf_element
Create a ready-to-use image, since it must be embedded in a frame.
The optionnal text will appear above the image.
Size is a (width, height) tuple and position is a (left, top) tuple; items are strings including the unit, e.g. (‘21cm’, ‘29.7cm’).
Arguments:
uri – str
text – unicode
size – (str, str)
anchor_type – ‘page’, ‘frame’, ‘paragraph’, ‘char’ or ‘as-char’
page_number – int (when anchor_type == ‘page’)
position – (str, str)
style – unicode
Return: odf_element
Create a ready-to-use text box, since it must be embedded in a frame.
Size is a (width, height) tuple and position is a (left, top) tuple; items are strings including the unit, e.g. (‘21cm’, ‘29.7cm’).
Arguments:
text_or_element – unicode or odf_element
size – (str, str)
anchor_type – ‘page’, ‘frame’, ‘paragraph’, ‘char’ or ‘as-char’
page_number – int (when anchor_type == ‘page’)
position – (str, str)
style – unicode
text_style – unicode
Return: odf_element