Composable API

LAParams

class pdfminer.layout.LAParams(line_overlap: float = 0.5, char_margin: float = 2.0, line_margin: float = 0.5, word_margin: float = 0.1, boxes_flow: Optional[float] = 0.5, detect_vertical: bool = False, all_texts: bool = False)

Parameters for layout analysis

Parameters:
  • line_overlap – If two characters have more overlap than this they are considered to be on the same line. The overlap is specified relative to the minimum height of both characters.
  • char_margin – If two characters are closer together than this margin they are considered part of the same line. The margin is specified relative to the width of the character.
  • word_margin – If two characters on the same line are further apart than this margin then they are considered to be two separate words, and an intermediate space will be added for readability. The margin is specified relative to the width of the character.
  • line_margin – If two lines are are close together they are considered to be part of the same paragraph. The margin is specified relative to the height of a line.
  • boxes_flow – Specifies how much a horizontal and vertical position of a text matters when determining the order of text boxes. The value should be within the range of -1.0 (only horizontal position matters) to +1.0 (only vertical position matters). You can also pass None to disable advanced layout analysis, and instead return text based on the position of the bottom left corner of the text box.
  • detect_vertical – If vertical text should be considered during layout analysis
  • all_texts – If layout analysis should be performed on text in figures.

Todo:

  • PDFDevice
    • TextConverter
    • PDFPageAggregator
  • PDFPageInterpreter