Skip to main content

从 pdf 文件中提取结构化文本。

项目描述

叶焦点

从 pdf 文件中提取结构化文本。

安装

使用 pip 从 PyPI 安装:

pip install leaf-focus

派皮 PyPI - Python 版本 GitHub 工作流状态(分支)

下载Xpdf 命令行工具并解压可执行文件。

将包含可执行文件的目录提供为--exe-dir.

用法

usage: leaf-focus [-h] [--version] --exe-dir EXE_DIR [--page-images] [--ocr]
                  [--first FIRST] [--last LAST]
                  [--log-level {debug,info,warning,error,critical}]
                  input_pdf output_dir

Extract structured text from a pdf file.

positional arguments:
  input_pdf             path to the pdf file to read
  output_dir            path to the directory to save the extracted text files

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --exe-dir EXE_DIR     path to the directory containing xpdf executable files
  --page-images         save each page of the pdf as a separate image
  --ocr                 run optical character recognition on each page of the
                        pdf
  --first FIRST         the first pdf page to process
  --last LAST           the last pdf page to process
  --log-level {debug,info,warning,error,critical}
                        the log level: debug, info, warning, error, critical

例子

# Extract the pdf information and embedded text.
leaf-focus --exe-dir [path-to-xpdf-exe-dir] file.pdf file-pages

# Extract the pdf information, embedded text, an image of each page, and Optical Character Recognition results of each page.
leaf-focus --exe-dir [path-to-xpdf-exe-dir] file.pdf file-pages --ocr

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

leaf-focus-0.5.0.tar.gz (24.2 kB 查看哈希)

已上传 source

内置分布

Leaf_focus-0.5.0-py3-none-any.whl (25.0 kB 图哈希)

已上传 py3