Independent guide. Not affiliated with the pdfplumber project or its maintainers.Official repository: jsvine/pdfplumber ↗

Reference

pdfplumber API index

pdfplumber's official documentation is its README on GitHub. This index lists every public function, method and property with the signature from version 0.11.10, a plain-language summary, and a link to the guide where we show it working.

Tested with pdfplumber 0.11.10 · Python 3.13Updated 2026-11-04Source of truth: official README ↗

How the library is organised

  1. pdfplumber.open(path) returns a PDF. Use it as a context manager so the file is closed.
  2. pdf.pages is a list of Page objects. Everything happens on pages: objects, text, tables.
  3. Pages expose objects (chars, lines, rects, curves, images, annots) and methods that combine them (extract_text(), extract_tables(), search()).
  4. crop(), within_bbox() and filter() return new pages limited to part of the original, with all the same methods.
  5. page.to_image() gives a PageImage for drawing what pdfplumber found.

Signatures below are introspected from the installed library; defaults that are hidden behind **kwargs (text and table options) are documented on extract text and table_settings.

Module

pdfplumber.repair(path_or_fp, outfile=None, password=None, gs_path=None, setting='default') function
Rewrite a damaged PDF with Ghostscript and return the repaired bytes (or write them to outfile).

PDF (from pdfplumber.open)

pdf.pages property
List of Page objects, one per page (only the pages requested with pages= when opening).
pdf.metadata property
Document information dictionary: Title, Author, Producer, CreationDate…
pdf.close() method
Close the underlying file. Called automatically by the with-statement.
pdf.chars property
All characters from all pages (also lines, rects, curves, images, annots, hyperlinks).
pdf.structure_tree property
Logical structure of a tagged PDF as nested dicts (empty if untagged).
pdf.to_json(stream=None, object_types=None, include_attrs=None, exclude_attrs=None, precision=None, indent=None) method
Serialise every object on every page to JSON (also to_csv, to_dict).

Page (pdf.pages[i], also cropped/filtered pages)

page.page_number property
1-based page number.
page.width property
Page width in points (also height).
page.bbox property
(x0, top, x1, bottom) of the page or of the cropped region.
page.mediabox property
Page boxes in top-left coordinates: mediabox, cropbox, trimbox, bleedbox, artbox.
page.rotation property
The page's /Rotate value (0, 90, 180, 270).
page.chars property
Every character with text, position, font, size and colours.
page.lines property
Drawn line segments with positions, width and colour.
page.rects property
Drawn rectangles.
page.curves property
Drawn curves with their points.
page.images property
Embedded images with their position and source size.
page.annots property
Annotations (links, comments, highlights).
page.hyperlinks property
Link annotations with a URI.
page.edges property
Lines plus the sides of rects and curves, as used by the table finder.
page.objects property
Dict of every object list on the page, keyed by type.
page.extract_text(**kwargs) method
Join characters into text. Options: layout, x_tolerance(_ratio), y_tolerance, directions…
page.extract_text_simple(**kwargs) method
Faster text extraction without layout logic.
page.extract_text_lines(strip=True, return_chars=True, **kwargs) method
Text lines with their bounding boxes (and chars).
page.extract_words(**kwargs) method
Words with bounding boxes; options for tolerances, fonts (extra_attrs), punctuation.
page.search(pattern, regex=True, case=True, main_group=0, return_chars=True, return_groups=True, **kwargs) method
Find a string or regex; returns matches with their position and chars.
page.extract_table(table_settings=None) method
Largest table as a list of rows (or None).
page.extract_tables(table_settings=None) method
Every table as a list of row lists.
page.find_table(table_settings=None) method
Largest table as a Table object (or None).
page.find_tables(table_settings=None) method
Every table as Table objects with bbox, cells, rows, columns.
page.debug_tablefinder(table_settings=None) method
The TableFinder with edges, intersections, cells and tables for given settings.
page.crop(bbox, relative=False, strict=True) method
Page restricted to a bbox; objects partly inside are kept and trimmed.
page.within_bbox(bbox, relative=False, strict=True) method
Page restricted to objects entirely inside a bbox.
page.outside_bbox(bbox, relative=False, strict=True) method
Page restricted to objects entirely outside a bbox.
page.filter(test_function) method
Page with only the objects for which a function returns True.
page.dedupe_chars(**kwargs) method
Page without duplicated (overprinted) characters.
page.to_image(resolution=None, width=None, height=None, antialias=False, force_mediabox=False) method
Render the page to a PageImage for visual debugging (resolution, width or height).
page.close() method
Release the page's cached objects to free memory.
page.structure_tree property
Structure tree of this page (tagged PDFs).

Table (from find_tables)

table.bbox property
(x0, top, x1, bottom) of the table.
table.cells property
List of cell bboxes.
table.rows property
Rows, each with .cells (bboxes or None for spanned cells).
table.columns property
Columns, each with .cells.
table.extract(**kwargs) method
Text of each cell as a list of rows; accepts word-extraction options.

TableFinder (from debug_tablefinder)

finder.edges property
Edges after snapping, joining and filtering.
finder.intersections property
Dict of intersection points.
finder.cells property
Cell bboxes built from intersections.
finder.tables property
Table objects.

PageImage (from page.to_image)

im.save(dest, format='PNG', quantize=True, colors=256, bits=8, **kwargs) method
Write the image to a file (PNG by default).
im.show() method
Open the image in a viewer (in Jupyter, just display the object).
im.reset() method
Remove all drawings.
im.draw_rects(list_of_rects, fill=(0, 0, 255, 50), stroke=(255, 0, 0, 200), stroke_width=1) method
Draw rectangles (objects or bboxes); also draw_rect, draw_lines, draw_line.
im.draw_vlines(locations, stroke=(255, 0, 0, 200), stroke_width=1) method
Draw vertical lines at x positions; also draw_hlines, draw_vline, draw_hline.
im.debug_tablefinder(table_settings=None) method
Draw the table finder's edges, intersections and cells.

Reference pages