py_pdf_parser.visualise.main.visualise(document: py_pdf_parser.components.PDFDocument, page_number: int = 1, elements: ElementList = None, show_info: bool = False)

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.


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.

  • 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.