Class PdfDocumentReaderConfig.Builder

java.lang.Object
org.springframework.ai.reader.pdf.config.PdfDocumentReaderConfig.Builder
Enclosing class:
PdfDocumentReaderConfig

public static class PdfDocumentReaderConfig.Builder extends Object
  • Method Details

    • withPageExtractedTextFormatter

      public PdfDocumentReaderConfig.Builder withPageExtractedTextFormatter(ExtractedTextFormatter pageExtractedTextFormatter)
      Formatter of the extracted text.
      Parameters:
      pageExtractedTextFormatter - Instance of the PageExtractedTextFormatter.
      Returns:
      this builder
    • withPagesPerDocument

      public PdfDocumentReaderConfig.Builder withPagesPerDocument(int pagesPerDocument)
      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

      public PdfDocumentReaderConfig.Builder withPageTopMargin(int topMargin)
      Configures the Pdf reader page top margin. Defaults to 0.
      Parameters:
      topMargin - page top margin to use
      Returns:
      this builder
    • withPageBottomMargin

      public PdfDocumentReaderConfig.Builder withPageBottomMargin(int bottomMargin)
      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

      public PdfDocumentReaderConfig build()
      Returns the immutable configuration.
      Returns:
      the immutable configuration