Actions114
- AI Actions
- AI Advanced OCR
- Check Content Policy
- Detect Adult Content
- Detect Brand
- Detect Color
- Detect Email Type
- Detect Faces
- Enitity Detection
- Extract Contact Information
- Extract Customizable Information From Text
- Fuzzy Text Matcher
- Generate Image
- Generate Javascript Code
- Generate Python Code
- Language Detection
- Mood Detection
- PDF OCR
- Picture Object Recognition
- Picture Text Recognition
- Redact Sensitive Information From PDF
- Too Long To Read
- Transcribe
- Translation
- Business Actions
- Calculate Actions
- Code Actions
- Convert Actions
- Crypto Actions
- Date & Time Actions
- Generate Actions
- Image Actions
- Operator Actions
- PDF Actions
- Storage Actions
- Text Actions
- User Actions
PDF → HTML to PDF
AI-generatedOverview
This node operation converts HTML content or a URL pointing to HTML content into a PDF document. It supports inputting either raw HTML code or a URL to a webpage, and allows customization of the PDF output such as paper format, scale, orientation (landscape or portrait), and whether to print background graphics. The output can be returned as a file buffer or as a URL to the generated PDF. This operation is useful for automating the creation of PDF documents from web content or HTML templates, for example generating reports, invoices, or printable documents from dynamic HTML sources.
Use Case Examples
- Convert a webpage URL to a PDF document for archiving or sharing.
- Generate a PDF from custom HTML code for creating formatted reports or invoices.
- Customize PDF output format and orientation for specific printing requirements.
Properties
| Name | Meaning |
|---|---|
| Code Variables | Allows setting variables defined in the code editor to be used during the PDF generation process. |
| Get File as URL | Boolean option to specify whether the generated PDF should be returned as a URL instead of a file buffer. |
| URL or HTML Code | Select whether the source for the PDF conversion is a URL or raw HTML code. |
| URL | The URL of the webpage to convert to PDF. Required if 'URL or HTML Code' is set to URL. |
| HTML Code | The raw HTML code to convert to PDF. Required if 'URL or HTML Code' is set to HTML. |
| Options | Additional PDF generation options such as paper format, scale, landscape mode, and whether to print background graphics. |
Output
JSON
pdf- The generated PDF file content or URL depending on the 'Get File as URL' setting.
Dependencies
- Requires an API key credential for the CodeKit API to perform the PDF conversion.
Troubleshooting
- Ensure the HTML or URL provided is accessible and valid to avoid conversion errors.
- If the PDF is not generated as expected, check the options for format, scale, and orientation for correctness.
- If 'Get File as URL' is enabled, ensure the environment can access the returned URL.
- Common errors may include network issues, invalid HTML, or API authentication failures. Verify API credentials and network connectivity.
Links
- 0CodeKit Node Documentation - Official documentation for the 0CodeKit node in n8n, including usage and configuration details.