PDF Box icon

PDF Box

Extrae texto e imágenes de archivos PDF usando Apache PDFBox

Extraer Texto

AI-generated

Overview

This node uses Apache PDFBox to extract text or images from PDF files. It is useful for automating the processing of PDF documents, such as extracting readable text for analysis or retrieving embedded images for further use. For example, it can extract the full text content of a PDF report or extract all images from a PDF catalog.

Use Case Examples

  1. Extract text from a PDF invoice to analyze its content.
  2. Extract images from a PDF brochure for use in marketing materials.

Properties

Name Meaning
Archivo PDF The binary property name containing the PDF file to process.
Opciones Options for text extraction, including whether to include text statistics and the maximum buffer size for large PDFs.

Output

JSON

  • text - Extracted text content from the PDF.
  • fileName - Original file name of the PDF.
  • mimeType - MIME type of the PDF file.
  • stats
    • lines - Number of lines in the extracted text (if statistics are included).
    • words - Number of words in the extracted text (if statistics are included).
    • characters - Number of characters in the extracted text (if statistics are included).
    • sizeKB - Size of the extracted text in kilobytes (if statistics are included).
  • extractedAt - Timestamp when the text extraction was performed.

Dependencies

  • Apache PDFBox (used via a Node.js wrapper script)
  • Node.js child_process module to execute the PDFBox wrapper script

Troubleshooting

  • Ensure the binary property name matches the actual binary input containing the PDF file.
  • Large PDFs may require increasing the Max Buffer size option to avoid buffer overflow errors.
  • Errors during extraction will throw messages indicating the failure; enabling 'Continue On Fail' allows processing to continue with error details in output.

Links

  • Apache PDFBox - Official site for Apache PDFBox, the underlying library used for PDF text and image extraction.

Discussion