# MathpixPDFLoader

> **Class** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/document_loaders/pdf/MathpixPDFLoader)

Load `PDF` files using `Mathpix` service.

## Signature

```python
MathpixPDFLoader(
    self,
    file_path: Union[str, PurePath],
    processed_file_format: str = 'md',
    max_wait_time_seconds: int = 500,
    should_clean_pdf: bool = False,
    extra_request_data: Optional[dict[str, Any]] = None,
    **kwargs: Any = {},
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `file_path` | `Union[str, PurePath]` | Yes | a file for loading. |
| `processed_file_format` | `str` | No | a format of the processed file. Default is "md". (default: `'md'`) |
| `max_wait_time_seconds` | `int` | No | a maximum time to wait for the response from the server. Default is 500. (default: `500`) |
| `should_clean_pdf` | `bool` | No | a flag to clean the PDF file. Default is False. (default: `False`) |
| `extra_request_data` | `Optional[dict[str, Any]]` | No | Additional request data. (default: `None`) |
| `**kwargs` | `Any` | No | additional keyword arguments. (default: `{}`) |

## Extends

- `BasePDFLoader`

## Constructors

```python
__init__(
    self,
    file_path: Union[str, PurePath],
    processed_file_format: str = 'md',
    max_wait_time_seconds: int = 500,
    should_clean_pdf: bool = False,
    extra_request_data: Optional[dict[str, Any]] = None,
    **kwargs: Any = {},
) -> None
```

| Name | Type |
|------|------|
| `file_path` | `Union[str, PurePath]` |
| `processed_file_format` | `str` |
| `max_wait_time_seconds` | `int` |
| `should_clean_pdf` | `bool` |
| `extra_request_data` | `Optional[dict[str, Any]]` |


## Properties

- `mathpix_api_key`
- `mathpix_api_id`
- `processed_file_format`
- `extra_request_data`
- `max_wait_time_seconds`
- `should_clean_pdf`
- `url`
- `data`

## Methods

- [`send_pdf()`](https://reference.langchain.com/python/langchain-community/document_loaders/pdf/MathpixPDFLoader/send_pdf)
- [`wait_for_processing()`](https://reference.langchain.com/python/langchain-community/document_loaders/pdf/MathpixPDFLoader/wait_for_processing)
- [`get_processed_pdf()`](https://reference.langchain.com/python/langchain-community/document_loaders/pdf/MathpixPDFLoader/get_processed_pdf)
- [`clean_pdf()`](https://reference.langchain.com/python/langchain-community/document_loaders/pdf/MathpixPDFLoader/clean_pdf)
- [`load()`](https://reference.langchain.com/python/langchain-community/document_loaders/pdf/MathpixPDFLoader/load)

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/4b280287bd55b99b44db2dd849f02d66c89534d5/libs/community/langchain_community/document_loaders/pdf.py#L861)