Actions40
- AI Actions
- Business Actions
- Calculate Actions
- Code Actions
- Convert Actions
- Crypto Actions
- Generate Actions
- Operator Actions
- PDF Actions
- Storage Actions
Overview
The Count PDF Pages operation in the "PDF" resource of this custom n8n node allows you to determine the number of pages in a PDF document. This can be useful in workflows where you need to validate, process, or split PDFs based on their length. For example, you might use this node to:
- Automatically route documents with more than a certain number of pages for further review.
- Generate summaries or reports that include page counts.
- Pre-process files before splitting or merging operations.
Properties
| Name | Meaning |
|---|---|
| URL or Binary Data | Choose the source type for the PDF: either provide a direct URL to the PDF file ("URL") or supply binary data from a previous node ("Binary Data"). Options: URL, Binary Data. |
| URL | The web address of the PDF file to analyze. Required if "URL or Binary Data" is set to "URL". |
| Binary Data | The name of the binary property containing the PDF data (from a previous node). Required if "URL or Binary Data" is set to "Binary Data". |
Output
The output will be a JSON object containing the result of the page count operation. While the exact structure may depend on the API response, typically you can expect:
{
"pages": <number>
}
Where pages is the total number of pages detected in the provided PDF.
If an error occurs and "Continue On Fail" is enabled, the output will include an error field with the error message.
Dependencies
- External Service: Requires access to the CodeKit API (as indicated by the required
codeKitApicredential). - n8n Configuration: You must configure the
codeKitApicredential in your n8n instance.
Troubleshooting
Common Issues:
- Invalid URL or Unreachable File: If the provided URL is incorrect or the file is not accessible, the node will return an error.
- Incorrect Binary Property Name: If using "Binary Data", ensure the property name matches the binary output from the previous node.
- Missing Credentials: If the
codeKitApicredential is not configured, the node will fail to execute.
Error Messages:
"error": "Error: ..."— Indicates a problem with the input or external service. Check the error message for details such as network issues, authentication failures, or invalid file formats.
Links and References
- n8n Documentation: Custom Nodes
- PDF Page Count Use Cases (general reference)
- For support with the CodeKit API, refer to your provider's documentation or contact their support.