<!-- Source: https://docs.squirro.com/en/latest/api/squirro.lib.nlp.steps.tokenizers.PdfPagesTokenizer.html -->
# PdfPagesTokenizer

**`class PdfPagesTokenizer(config)`**

Bases: [`BatchedStep`](../technical/libnlp/steps/standard.md#squirro.lib.nlp.steps.batched_step.BatchedStep)

PDF Pages Extractor: reads each PDF in your files field and extracts full-page
text content using PyMuPDF (fitz).

**Input: expects doc.fields[‘files’] to be a list of dicts:**

{ ‘mime_type’: ‘application/pdf’, ‘content_url’: ‘<path_or_url>’ }

**Output: writes to doc.fields[output_field] (default ‘pages’) a list of dicts:**

[{ ‘page_number’: int, ‘text’: str }, …]

Parameters

- `type` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – ‘pdf_pages’
- `output_field` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – field to write the pages list (default: ‘pages’)
- `page_count` ([`int`](https://docs.python.org/3.11/library/functions.html#int)`, ``None`) – if set, only extract this many pages from each PDF

Methods SummaryMethods Documentation

**`process_doc(doc)`**

Process a document

Parameters

`doc` ([`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)) – Document

Returns

Processed document

Return type

[Document](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)
