Visualise

py_pdf_parser.visualise.main.visualise(document: py_pdf_parser.components.PDFDocument, page_number: int = 1, elements: Optional[ElementList] = None, show_info: bool = False, width: Optional[int] = None, height: Optional[int] = None) → None

Visualises a PDFDocument, allowing you to inspect all the elements.

Will open a Matplotlib window showing the page_number. You can use the black buttons on the right of the toolbar to navigate through pages.

Warning

In order to show you the actual PDF behind the elements, your document must be initialised with pdf_file_path, and your PDF must be at the given path. If this is not done, the background will be white.

Parameters:
  • document (PDFDocument) – The pdf document to visualise.
  • page_number (int) – The page to visualise. Note you can change pages using the arrow keys in the visualisation window.
  • elements (ElementList, optional) – Which elements of the document to visualise. Defaults to all of the elements in the document.
  • show_info (bool) – Shows an additional window allowing you to click on PDFElements and see details about them. Default: False.
  • width – (int, optional): The initial width of the visualisation window. Default: Screen width.
  • height – (int, optional): The initial height of the visualisation window. Default: Screen height.