PDFTextWritingTool
Description
Write text at precise coordinates on a PDF page, optionally embedding a custom TrueType font.Parameters
Run Parameters
pdf_path
(str, required): Path to the input PDF.text
(str, required): Text to add.position
(tuple[int, int], required):(x, y)
coordinates.font_size
(int, default12
)font_color
(str, default"0 0 0 rg"
)font_name
(str, default"F1"
)font_file
(str, optional): Path to.ttf
file.page_number
(int, default0
)
Example
Code
Direct usage
Code
Tips
- Coordinate origin is the bottom‑left corner.
- If using a custom font (
font_file
), ensure it is a valid.ttf
.