Overview
This node, PDF & Excel Processor, is designed to process PDF and Excel files within n8n workflows. Specifically, for the "Default" resource and "Get Metadata" operation, it extracts metadata from PDF files provided as binary input. This is useful in scenarios where you need to programmatically access information such as author, creation date, or other document properties from PDFs stored or received in your automation processes.
Practical examples:
- Automatically cataloging uploaded PDF documents by extracting their metadata.
- Building a workflow that routes documents based on their metadata (e.g., author or creation date).
- Auditing or reporting on batches of PDF files by collecting their metadata into a database or spreadsheet.
Properties
| Name | Type | Meaning |
|---|---|---|
| File Type | options | Type of file to process. For this operation, should be set to "PDF". |
| Binary Property | string | Name of the binary property containing the file data. |
Output
The output will be a JSON object with the following structure:
{
"pdfResults": {
// ...metadata fields returned by the processor,
"operation": "getMetadata",
"success": true,
"timestamp": "2024-06-01T12:34:56.789Z"
}
}
- The
pdfResultsfield contains:- The extracted metadata fields from the PDF (the exact keys depend on the PDF and processor implementation).
operation: Always"getMetadata"for this operation.success: Boolean indicating successful processing.timestamp: ISO timestamp when the operation was performed.
If an error occurs and "Continue On Fail" is enabled, the output will instead contain:
{
"error": "Error message here"
}
Dependencies
- Binary Data: The node requires a valid binary property containing the PDF file data, typically provided by a previous node.
- No external API keys are required for this operation.
- The node relies on internal processor modules (
ProcessorFactory) bundled with the custom node.
Troubleshooting
Common issues:
- No binary data found: Occurs if the input item does not have a
binaryproperty. Ensure the previous node outputs binary data. - Binary property 'X' not found: The specified binary property name does not exist. Double-check the property name matches the output of the previous node.
- Binary data in property 'X' is invalid or missing data content: The binary property exists but lacks valid base64-encoded data. Verify the upstream node provides correct binary data.
- Failed to create buffer from binary data: The binary data is malformed or not properly base64-encoded.
How to resolve:
- Make sure the file is correctly uploaded or passed from a previous node.
- Confirm the binary property name matches exactly (case-sensitive).
- If using "Continue On Fail," check the
errorfield in the output for diagnostic messages.