Class PdfDocumentReaderConfig.Builder
java.lang.Object
org.springframework.ai.reader.pdf.config.PdfDocumentReaderConfig.Builder
- Enclosing class:
PdfDocumentReaderConfig
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns the immutable configuration.withPageBottomMargin
(int bottomMargin) Configures the Pdf reader page bottom margin.withPageExtractedTextFormatter
(ExtractedTextFormatter pageExtractedTextFormatter) Formatter of the extracted text.withPagesPerDocument
(int pagesPerDocument) How many pages to put in a single Document instance.withPageTopMargin
(int topMargin) Configures the Pdf reader page top margin.withReversedParagraphPosition
(boolean reversedParagraphPosition) Configures the Pdf reader reverse paragraph position.
-
Method Details
-
withPageExtractedTextFormatter
public PdfDocumentReaderConfig.Builder withPageExtractedTextFormatter(ExtractedTextFormatter pageExtractedTextFormatter) Formatter of the extracted text.- Parameters:
pageExtractedTextFormatter
- Instance of the PageExtractedTextFormatter.- Returns:
- this builder
-
withPagesPerDocument
How many pages to put in a single Document instance. 0 stands for all pages. Defaults to 1.- Parameters:
pagesPerDocument
- Number of page's content to group in single Document.- Returns:
- this builder
-
withPageTopMargin
Configures the Pdf reader page top margin. Defaults to 0.- Parameters:
topMargin
- page top margin to use- Returns:
- this builder
-
withPageBottomMargin
Configures the Pdf reader page bottom margin. Defaults to 0.- Parameters:
bottomMargin
- page top margin to use- Returns:
- this builder
-
withReversedParagraphPosition
public PdfDocumentReaderConfig.Builder withReversedParagraphPosition(boolean reversedParagraphPosition) Configures the Pdf reader reverse paragraph position. Defaults to false.- Parameters:
reversedParagraphPosition
- to reverse or not the paragraph position withing a page.- Returns:
- this builder
-
build
Returns the immutable configuration.- Returns:
- the immutable configuration
-