47fac22230
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.1 KiB
2.1 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| pdf_add_text | function | py | infra | 1.0.0 | impure | def pdf_add_text(doc, text, style, x, y, width) -> PDFDoc | Escribe un bloque de texto en el documento PDF con fuente, tamaño, color y alineacion del PDFStyle dado. Soporta saltos de linea y word wrap automatico. |
|
|
|
false | error_go_core |
|
PDFDoc con el texto añadido en la pagina activa | true |
|
python/functions/infra/pdf_add_text_test.py | python/functions/infra/pdf_add_text.py |
Ejemplo
from pdf_style import PDFStyle
titulo = PDFStyle(font_family="Helvetica-Bold", font_size=18.0, alignment="center")
cuerpo = PDFStyle(font_size=11.0, alignment="justify", margin_bottom=4.0)
doc = pdf_add_text(doc, "Informe Mensual", style=titulo)
doc = pdf_add_text(doc, "Este reporte resume las ejecuciones de Abril 2026.", style=cuerpo)
Notas
Usa multi_cell internamente para soportar word wrap automatico y saltos de linea \n. La altura de linea se calcula en mm a partir de font_size * line_height. Las fuentes built-in soportan variantes -Bold, -Oblique, -BoldOblique en el nombre de font_family (se separan internamente para fpdf2).