tools.pdf_generator module
Advanced PDF Generator Tool.
Creates complex PDFs from JSON specifications with text, images, tables, headers, links, and various styling options across multiple pages.
- class tools.pdf_generator.LinkFlowable(text, url, style=None)[source]
Bases:
FlowableLinkFlowable (inherits from Flowable).
- text
The text.
- url
The url.
- style
The style.
- width
The width.
- height
The height.
- paragraph
The paragraph.
- __init__(text, url, style=None)[source]
Initialize the instance.
- Parameters:
text – Text content.
url – URL string.
style – The style value.
- class tools.pdf_generator.PDFGenerator(page_size='A4')[source]
Bases:
objectPDFGenerator.
- Parameters:
page_size (str)
- page_size
The page size.
- styles
The styles.
- async tools.pdf_generator.run(pdf_spec, filename=None, ctx=None)[source]
Execute this tool and return the result.
- Parameters:
pdf_spec (
str) – The pdf spec value.filename (
str) – The filename value.ctx (
ToolContext|None) – Tool execution context providing access to bot internals.
- Returns:
Result string.
- Return type: