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_header_footer | function | py | infra | 1.0.0 | impure | def pdf_add_header_footer(doc, header_text, footer_text, page_numbers) -> PDFDoc | Configura header y/o footer recurrente para todas las paginas del documento. Debe llamarse antes de pdf_add_page. El footer acepta {n} y {total} como placeholders para numeracion automatica. |
|
|
|
false | error_go_core |
|
PDFDoc con la configuracion de header/footer guardada; se aplica en cada pdf_add_page posterior | false | python/functions/infra/pdf_add_header_footer.py |
Ejemplo
doc = pdf_create(title="Reporte Mensual")
# Header con nombre del reporte, footer con numeracion
doc = pdf_add_header_footer(
doc,
header_text="Reporte de Ejecuciones — Abril 2026",
footer_text="Pagina {n} de {total}",
page_numbers=True,
)
# Las paginas añadidas despues tendran header y footer
doc = pdf_add_page(doc)
doc = pdf_add_text(doc, "Contenido...")
Notas
Internamente configura los campos header_text, footer_text y page_numbers del PDFDoc. La subclase _PDFWithHeaderFooter de pdf_create lee estos campos en sus metodos header() y footer() que fpdf2 llama automaticamente en cada add_page(). El alias {nb} de fpdf2 se activa via alias_nb_pages y fpdf2 lo reemplaza al renderizar el PDF final. Debe llamarse antes de cualquier pdf_add_page para que el header/footer se aplique a todas las paginas.