pdfreader.document submodule

class pdfreader.document.PDFDocument(fobj, password='')

Constructor method

root = None

references to document’s Catalog instance

header = None

contains PDF file header data

trailer = None

contains PDF file trailer data

property metadata

Returns document metadata from file’s trailer info dict


dict, if metadata exists None otherwise.


Yields document pages one by one.


Page generator.

build(obj, visited=None, lazy=True)

Resolves all indirect references for the object.

  • obj (one of supported PDF types) – an object from the document

  • lazy (bool) – don’t resolve subsequent indirect references if True (default).

  • visited – Shouldn’t be used. Internal param containing already resolved objects to not fall into infinite loops

locate_object(num, gen)