--- name: pdf_from_html kind: function lang: py domain: infra version: "1.0.0" purity: impure signature: "def pdf_from_html(html_string, output_path, page_size, css) -> str" description: "Convierte un HTML string a PDF usando weasyprint con soporte completo de CSS layout. Retorna error claro si weasyprint no esta instalado (requiere dependencias de sistema: pango, cairo)." tags: [pdf, html, weasyprint, conversion, infra] uses_functions: [] uses_types: [] returns: [] returns_optional: false error_type: "error_go_core" imports: [weasyprint] params: - name: html_string desc: "contenido HTML completo como string, incluyendo head y body" - name: output_path desc: "ruta del archivo PDF a generar" - name: page_size desc: "tamaƱo de pagina CSS: A4, letter, A3. Por defecto A4" - name: css desc: "CSS adicional como string para aplicar sobre el HTML, puede incluir fuentes y layouts" output: "output_path con el PDF guardado en disco" tested: false tests: [] test_file_path: "" file_path: "python/functions/infra/pdf_from_html.py" --- ## Ejemplo ```python html = """
| Dominio | Funciones |
|---|---|
| core | 45 |