Overview
This node extracts specific pages from a PDF file provided as a base64-encoded string. It is useful for scenarios where you need to split a PDF document and retrieve only certain pages, such as extracting chapters, sections, or relevant pages from a larger document. For example, you can input a PDF and specify pages like "1-3;5;8-10" to get a new PDF containing only those pages.
Use Case Examples
- Extract pages 1 to 3, page 5, and pages 8 to 10 from a PDF document.
- Create a new PDF containing only selected pages from a larger PDF file.
Properties
| Name | Meaning |
|---|---|
| The content of the PDF encoded in base64 format. | |
| Pages | The pages to extract from the PDF, specified as ranges or individual pages (e.g., "1-3;5;8-10"). |
Output
Binary
The output contains the extracted pages as a new PDF file in binary format under the key 'data'.
Dependencies
- pdf-lib library for PDF manipulation
Troubleshooting
- Ensure the input PDF is correctly base64 encoded; otherwise, loading the PDF will fail.
- The 'Pages' input must be correctly formatted as ranges or individual page numbers separated by semicolons, spaces, or commas. Invalid page numbers or formats will be ignored or cause errors.
- If the specified pages exceed the total page count of the PDF, only available pages up to the maximum will be extracted.