Class PdfDocumentReaderConfig
java.lang.Object
org.springframework.ai.reader.pdf.config.PdfDocumentReaderConfig
Common configuration builder for the
PagePdfDocumentReader and the
ParagraphPdfDocumentReader.- Author:
- Christian Tzolov
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intfinal intfinal ExtractedTextFormatterfinal intfinal intfinal boolean -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Start building a new configuration.static PdfDocumentReaderConfigReturns the default config.booleanWhether any page ranges are configured.booleanisPageSelected(int pageNumber) Whether the given one-based page number should be read.
-
Field Details
-
ALL_PAGES
public static final int ALL_PAGES- See Also:
-
reversedParagraphPosition
public final boolean reversedParagraphPosition -
pagesPerDocument
public final int pagesPerDocument -
pageTopMargin
public final int pageTopMargin -
pageBottomMargin
public final int pageBottomMargin -
pageExtractedTextFormatter
-
-
Method Details
-
builder
Start building a new configuration.- Returns:
- The entry point for creating a new configuration.
-
defaultConfig
Returns the default config.- Returns:
- the default config
-
isPageSelected
public boolean isPageSelected(int pageNumber) Whether the given one-based page number should be read. When no page ranges are configured every page is read; otherwise a page is read when it falls within any of the configured inclusive ranges.- Parameters:
pageNumber- the one-based page number- Returns:
trueif the page should be read
-
hasPageRanges
public boolean hasPageRanges()Whether any page ranges are configured. Readers that do not support page ranges can use this to reject such a configuration instead of silently ignoring it.- Returns:
trueif at least one page range has been configured
-