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. Position is relative to the context the frame is inserted in. 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
draw_id – unicode
style – unicode
position – (str, str)
size – (str, str)
z_index – int (default 0)
presentation_class – unicode
anchor_type – ‘page’, ‘frame’, ‘paragraph’, ‘char’ or ‘as-char’
page_number (anchor_type=’page’) – int
layer – unicode
presentation_style – unicode
Return: odf_frame
Helper style for positioning frames in desktop applications that need it.
Default arguments should be enough.
Use the return value as the frame style or build a new graphic style with this style as the parent.
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:
url – str
text – unicode
name – unicode
draw_id – unicode
style – unicode
position – (str, str)
size – (str, str)
z_index – int (default 0)
presentation_class – unicode
anchor_type – ‘page’, ‘frame’, ‘paragraph’, ‘char’ or ‘as-char’
page_number (anchor_type=’page’) – int
layer – unicode
presentation_style – unicode
Return: odf_frame
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
text_style – unicode
name – unicode
draw_id – unicode
style – unicode
position – (str, str)
size – (str, str)
z_index – int (default 0)
presentation_class – unicode
anchor_type – ‘page’, ‘frame’, ‘paragraph’, ‘char’ or ‘as-char’
page_number (anchor_type=’page’) – int
layer – unicode
presentation_style – unicode
Return: odf_frame