Overview
This node converts DOCX files to PDF format and splits the resulting PDF into individual pages. It is useful for workflows that require processing or distributing each page of a DOCX document separately as a PDF file. For example, it can be used to split a multi-page report into single-page PDFs for easier sharing or printing.
Use Case Examples
- Splitting a DOCX report into individual PDF pages for distribution.
- Extracting specific pages from a DOCX document and converting them to separate PDFs.
- Including the full converted PDF along with individual page PDFs for archival purposes.
Properties
| Name | Meaning |
|---|---|
| Binary Property | Name of the binary property containing the DOCX file. |
| File Name Prefix | Prefix for the output file names. |
| Include Page Number | Whether to include page number in the output file names. |
| Start Number At | The number to start counting pages from. |
| Page Range | Range of pages to split (e.g., "1-5,8,11-13"). Leave empty to split all pages. |
| Keep Original PDF | Whether to include the converted full PDF in the output. |
| Page Size | Page size for the PDF output. |
Output
JSON
totalPages- Total number of pages in the converted PDF.fileName- Name of the output PDF file.pageNumber- Page number of the individual PDF page (if output is a single page).error- Error message if the node fails on an item and continueOnFail is enabled.
Dependencies
- mammoth (for extracting text from DOCX)
- pdf-lib (for PDF manipulation)
- pdfkit (for PDF generation)
Troubleshooting
- Ensure the input binary property contains a valid DOCX file; otherwise, the node will throw an error indicating missing binary data.
- If the page range is incorrectly formatted, pages outside the valid range will be ignored; use the format like '1-5,8,11-13'.
- If the node fails on an item and continueOnFail is not enabled, the workflow will stop execution; enable continueOnFail to handle errors gracefully.