Skip to main content

ParsePdfDocument

Description

Parses a PDF file, extracting the text and additional information into a structured JSON document. Additionally, any images or tables found in the document are extracted and routed to separate relationships. Their contents are optionally stored in the Document JSON itself, either as a Base64 encoded image or as text extracted from the image (or both). This Processor extracts the information in such a manner as to preserve the original document's layout, including the hierarchy of the sections within the document.

Tags

datavolo, document, extract, image, ocr, parse, pdf, rag, retrieval augmented generation, table, text, unstructured

Properties

In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Service Location Strategy *Service Location StrategyDefault
  • Default
  • Custom
Determines how Service Locations are configured within this processor for the Datavolo Document Element Detection Service.
Custom Element Detection Service URL *Custom Element Detection Service URLThe Custom URL to the Datavolo Document Element Detection Service.

This property is only considered if:
  • the property Service Location Strategy has a value of Custom
OCR Service *OCR ServiceController Service:
OCRService

Implementations:
StandardOCRService
An OCR Service for reading files to output text.
Table Embedding Strategy *Table Embedding StrategyExtract as Text
  • Extract as Image
  • Extract as Text
  • Extract as Image and Text
  • Skip
When a table is found in the document, this property specifies how the table should be embedded into the document.
Image Embedding Strategy *Image Embedding StrategyExtract as Text
  • Extract as Image
  • Extract as Text
  • Extract as Image and Text
  • Skip
When an image is found in the document, this property specifies how the image should be embedded into the document.
Communication Timeout *Communication Timeout60 secThe amount of time to wait for a response from the microservices before timing out.

Dynamic Properties

This component does not support dynamic properties.

Relationships

NameDescription
comms.failureIf the processor is unable to communicate with one of the necessary services, the input FlowFile will be routed to this relationship.
failureIf the text of a FlowFile cannot be extracted for any reason, the input FlowFile will be routed to this relationship.
imagesIf an image is found in the document, the image will be routed to this relationship.
successThe text of the PDF is routed to the success relationship.
tablesIf a table is found in the document, the image of the table will be routed to this relationship.

Reads Attributes

This processor does not read attributes.

Writes Attributes

NameDescription
container.scopeThe scope of the container is set to DOCUMENT for the JSON Document, TABLE for tables, and FIGURE for any figures/images identified
document.idA unique UUID for the document
fragment.countThe total number of fragments
fragment.indexThe index of the fragment
mime.typeThe MIME type is set to 'application/json' for the JSON document, 'image/png' for any extracted images.
page.countThe number of pages in the PDF file is added to the JSON document.

State Management

This component does not store state.

Restricted

This component is not restricted.

Input Requirement

This component requires an incoming relationship.

System Resource Considerations

This component does not specify system resource considerations.

See Also

ChunkText, ChunkDocument, MergeDocumentElements, ParseTableImage