# DedocFileLoader

> **Class** in `langchain_community`

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

DedocFileLoader document loader integration to load files using `dedoc`.

The file loader automatically detects the file type (with the correct extension).
The list of supported file types is gives at
https://dedoc.readthedocs.io/en/latest/index.html#id1.
Please see the documentation of DedocBaseLoader to get more details.

## Signature

```python
DedocFileLoader(
    self,
    file_path: str,
    *,
    split: str = 'document',
    with_tables: bool = True,
    with_attachments: Union[str, bool] = False,
    recursion_deep_attachments: int = 10,
    pdf_with_text_layer: str = 'auto_tabby',
    language: str = 'rus+eng',
    pages: str = ':',
    is_one_column_document: str = 'auto',
    document_orientation: str = 'auto',
    need_header_footer_analysis: Union[str, bool] = False,
    need_binarization: Union[str, bool] = False,
    need_pdf_table_analysis: Union[str, bool] = True,
    delimiter: Optional[str] = None,
    encoding: Optional[str] = None,
)
```

## Description

**Setup:**

Install ``dedoc`` package.

.. code-block:: bash

    pip install -U dedoc

**Instantiate:**

.. code-block:: python

from langchain_community.document_loaders import DedocFileLoader

loader = DedocFileLoader(
    file_path="example.pdf",
    # split=...,
    # with_tables=...,
    # pdf_with_text_layer=...,
    # pages=...,
    # ...
)

**Load:**

.. code-block:: python

    docs = loader.load()
    print(docs[0].page_content[:100])
    print(docs[0].metadata)

.. code-block:: python

    Some text
    {
        'file_name': 'example.pdf',
        'file_type': 'application/pdf',
        # ...
    }

**Lazy load:**

.. code-block:: python

    docs = []
    docs_lazy = loader.lazy_load()

    for doc in docs_lazy:
        docs.append(doc)
    print(docs[0].page_content[:100])
    print(docs[0].metadata)

.. code-block:: python

    Some text
    {
        'file_name': 'example.pdf',
        'file_type': 'application/pdf',
        # ...
    }

## Extends

- `DedocBaseLoader`

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/document_loaders/dedoc.py#L285)