pdf_parse_by_txt.py 722 Bytes
Newer Older
1
from magic_pdf.config.enums import SupportedPdfParseMethod
2
from magic_pdf.data.dataset import Dataset
3
from magic_pdf.pdf_parse_union_core_v2 import pdf_parse_union
赵小蒙's avatar
赵小蒙 committed
4

赵小蒙's avatar
赵小蒙 committed
5
6

def parse_pdf_by_txt(
7
    dataset: Dataset,
赵小蒙's avatar
赵小蒙 committed
8
9
10
11
12
    model_list,
    imageWriter,
    start_page_id=0,
    end_page_id=None,
    debug_mode=False,
13
    lang=None,
赵小蒙's avatar
赵小蒙 committed
14
):
15
16
    return pdf_parse_union(model_list,
                           dataset,
赵小蒙's avatar
赵小蒙 committed
17
                           imageWriter,
18
                           SupportedPdfParseMethod.TXT,
赵小蒙's avatar
赵小蒙 committed
19
20
21
                           start_page_id=start_page_id,
                           end_page_id=end_page_id,
                           debug_mode=debug_mode,
22
                           lang=lang,
赵小蒙's avatar
赵小蒙 committed
23
                           )