wolfhece.report.common
Module Contents
- wolfhece.report.common.pts2cm(pts)[source]
Convert points to centimeters for PyMuPDF.
One point equals 1/72 inches.
- wolfhece.report.common.pt2inches(pts)[source]
Convert points to inches for PyMuPDF.
One point equals 1/72 inches.
- wolfhece.report.common.inches2cm(inches)[source]
Convert inches to centimeters.
One inch equals 2.54 centimeters.
- wolfhece.report.common.cm2pts(cm)[source]
Convert centimeters to points for PyMuPDF.
One point equals 1/72 inches.
- wolfhece.report.common.cm2inches(cm)[source]
Convert centimeters to inches.
One inch equals 2.54 centimeters.
- wolfhece.report.common.A4_rect()[source]
Return the A4 rectangle in PyMuPDF units.
(0, 0) is the top-left corner in PyMuPDF coordinates.
- wolfhece.report.common.rect_cm(x, y, width, height)[source]
Create a rectangle in PyMuPDF units from centimeters.
(0, 0) is the top-left corner in PyMuPDF coordinates.
- wolfhece.report.common.get_rect_from_text(text, width, fontsize=10, padding=5)[source]
Get a rectangle that fits the text in PyMuPDF units.
- Parameters:
text – The text to fit in the rectangle.
width – The width of the rectangle in centimeters.
fontsize – The font size in points.
padding – Padding around the text in points.
- Returns:
A PyMuPDF rectangle that fits the text.
- wolfhece.report.common.list_to_html_aligned(list_items, font_size='10pt', font_family='Helvetica')[source]
- class wolfhece.report.common.DefaultLayoutA4(title: str, filename='', ox=0, oy=0, tx=0, ty=0, parent=None, is2D=True, idx='', plotted=True, mapviewer=None, need_for_wx=False, bbox=None, find_minmax=True, shared=False, colors=None)[source]
Bases:
wolfhece.PyVertexvectors.Zones
Enum for default layout options.
- add_element(name: str, width: float, height: float, x: float = 0, y: float = 0) wolfhece.PyVertexvectors.vector [source]
Add an element to the layout.
- add_element_repeated(name: str, width: float, height: float, first_x: float = 0, first_y: float = 0, count_x: int = 1, count_y: int = 1, padding: float = None) wolfhece.PyVertexvectors.zone [source]
- check_if_overlap(vec: wolfhece.PyVertexvectors.vector) bool [source]
Check if the vector overlaps with any existing vector in the layout.
- property useful_part: wolfhece.PyVertexvectors.vector[source]
Get the useful part of the page, excluding margins.
- property page_dimension: tuple[float, float][source]
Get the dimensions of the page in centimeters.