convert_html_to_pdf
Convert a local HTML file into a PDF by providing its file path. Configure layout, page format, scale, margins, print background, and header/footer as needed.
Instructions
Convert a local HTML file to PDF using the PDF4me ConvertHtmlToPdf API. Provide the file path to the HTML document. Configure layout, page format, scale, margins, print background, and header/footer. Optionally set output directory and output file name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scale | No | Content scale (e.g. 0.8 = 80%). | |
| layout | No | Portrait or Landscape. | Portrait |
| file_path | Yes | Local path to the HTML file (.html or .htm). | |
| output_dir | No | ||
| top_margin | No | 40px | |
| left_margin | No | 40px | |
| page_format | No | Page size (e.g. A4, Letter). | A4 |
| right_margin | No | 40px | |
| bottom_margin | No | 40px | |
| output_file_name | No | ||
| print_background | No | Include backgrounds in the PDF. | |
| display_header_footer | No | Show header/footer when supported. |