{"id":28183995,"url":"https://github.com/ad-freiburg/pdftotext-plus-plus","last_synced_at":"2025-05-16T05:12:38.171Z","repository":{"id":161076053,"uuid":"630106168","full_name":"ad-freiburg/pdftotext-plus-plus","owner":"ad-freiburg","description":"A fast and accurate command line tool for extracting text from PDF files.","archived":false,"fork":false,"pushed_at":"2023-10-04T15:40:25.000Z","size":19088,"stargazers_count":16,"open_issues_count":8,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-04T20:41:10.033Z","etag":null,"topics":["c-plus-plus","cli","document-analysis","metadata-extraction","pdf","text-extraction"],"latest_commit_sha":null,"homepage":"https://pdftotext.cs.uni-freiburg.de","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ad-freiburg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-04-19T17:20:04.000Z","updated_at":"2025-01-18T11:24:03.000Z","dependencies_parsed_at":"2023-09-29T16:25:47.261Z","dependency_job_id":null,"html_url":"https://github.com/ad-freiburg/pdftotext-plus-plus","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-freiburg%2Fpdftotext-plus-plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-freiburg%2Fpdftotext-plus-plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-freiburg%2Fpdftotext-plus-plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad-freiburg%2Fpdftotext-plus-plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ad-freiburg","download_url":"https://codeload.github.com/ad-freiburg/pdftotext-plus-plus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254470999,"owners_count":22076587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","cli","document-analysis","metadata-extraction","pdf","text-extraction"],"created_at":"2025-05-16T05:11:52.131Z","updated_at":"2025-05-16T05:12:38.128Z","avatar_url":"https://github.com/ad-freiburg.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cbr/\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/ad-freiburg/pdftotext-plus-plus\"\u003e\n    \u003cimg src=\"logo.png\" alt=\"logo\" width=\"200\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/ad-freiburg/pdftotext-plus-plus/actions/workflows/checkstyle.yml\"\u003e\n    \u003cimg src=\"https://github.com/ad-freiburg/pdftotext-plus-plus/actions/workflows/checkstyle.yml/badge.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/ad-freiburg/pdftotext-plus-plus/actions/workflows/unit_test.yml\"\u003e\n    \u003cimg src=\"https://github.com/ad-freiburg/pdftotext-plus-plus/actions/workflows/unit_test.yml/badge.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/ad-freiburg/pdftotext-plus-plus/actions/workflows/e2e_test.yml\"\u003e\n    \u003cimg src=\"https://github.com/ad-freiburg/pdftotext-plus-plus/actions/workflows/e2e_test.yml/badge.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pdftotext.cs.uni-freiburg.de\"\u003eExplore the docs\u003c/a\u003e\n  \u0026nbsp·\u0026nbsp\n  \u003ca href=\"https://github.com/ad-freiburg/pdftotext-plus-plus/issues/new?labels=bug\"\u003eReport a bug\u003c/a\u003e\n  \u0026nbsp·\u0026nbsp\n  \u003ca href=\"https://github.com/ad-freiburg/pdftotext-plus-plus/issues/new?labels=enhancement\"\u003eRequest a feature\u003c/a\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\nA fast and accurate command line tool for extracting text from PDF files. The main features are:\n* accurate detection of words, text lines and text blocks\n* splitting ligatures into separate characters, for example: *ﬃ* into *f*, *f*, and *i*.\n* merging characters with combining diacritical marks to single characters, for example: *`a* to *à*.\n* detecting the semantic roles (for example: *title*, *author*, *section heading*, *paragraph*, *footnote*) of text blocks\n* detecting the natural reading order of text blocks\n* merging hyphenated words\n* detecting sub- and superscripts\n* customizable output of the extracted text, for example: in plain text format, or in a structured format (JSONL) in which the text is annotated with layout information (for example: the font, the font size, or the position).\n\n*pdftotext++* is based on [Poppler's](https://gitlab.freedesktop.org/poppler/poppler) [pdftotext](https://gitlab.freedesktop.org/poppler/poppler/-/blob/master/utils/pdftotext.cc) and written in C++.\nThere are several installation options (for example, via Apt, Docker, or building from source), see the [description below](#installation).\n\n\u003c!-- =========================================================================================== --\u003e\n\n## Quick Usage Guide\n\nExtract the plain text from *file.pdf* and output it to the console:\n```\npdftotext++ file.pdf\n```\n\nExtract the plain text from *file.pdf* and write it to *output.txt*:\n```\npdftotext++ file.pdf output.txt\n```\n\nExtract the words from *file.pdf* and output them together with layout information in JSONL format:\n```\npdftotext++ --output-words file.pdf\n```\n\nExtract the text from *file.pdf*, output it to the console, and create a PDF file *words.pdf* in which a bounding box is drawn around each detected word (this is particularly useful for debugging purposes):\n```\npdftotext++ --visualize-words --visualization-path words.pdf file.pdf\n```\n\nPrint the full usage information:\n```\npdftotext++ --help\n```\n\n## Installation\n\n### Apt (recommended)\n(1) Install required packages (for example, to allow *Apt* to use a repository over HTTPS):\n```\nsudo apt-get update\nsudo apt-get install -y ca-certificates curl gnupg lsb-release\n```\n\n(2) Add *pdftotext++*'s official GPG key:\n```\nsudo mkdir -m 0755 -p /etc/apt/keyrings\ncurl -fsSL https://pdftotext.cs.uni-freiburg.de/download/apt/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/pdftotext-plus-plus.gpg\n```\n\n(3) Add the repository and install *pdftotext++*:\n```\necho \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/pdftotext-plus-plus.gpg] https://pdftotext.cs.uni-freiburg.de/download/apt $(lsb_release -cs) stable\" | sudo tee /etc/apt/sources.list.d/pdftotext-plus-plus.list \u003e /dev/null\nsudo apt-get update\nsudo apt-get install -y pdftotext++\n```\n\n(4) Run *pdftotext++* (type `pdftotext++ --help` to see the full usage information):\n```\npdftotext++ [options] \u003cpdf-file\u003e \u003coutput-file\u003e\n```\n\n### Docker\n\n(1) Clone the project:\n```\ngit clone git@github.com:ad-freiburg/pdftotext-plus-plus.git\ncd pdftotext-plus-plus\n```\n\n(2) Build a Docker image:\n```\ndocker build -f Dockerfiles/Dockerfile -t pdftotext-plus-plus .\n```\n\n(3) Run *pdftotext++*\n```\ndocker run --rm -it -v \u003cpdf-file\u003e:/file.pdf --name pdftotext-plus-plus pdftotext-plus-plus [options] /file.pdf \u003coutput-file\u003e\n```\n\n### DEB package\n\n(1) Download the DEB package associated with your distribution from the [latest release](https://github.com/ad-freiburg/pdftotext-plus-plus/releases/latest) (or from an older release listed on the [release page](https://github.com/ad-freiburg/pdftotext-plus-plus/releases)).\n\n(2) Install the package and its dependencies.\u003cbr\u003e\n```\ndpkg -i ./pdftotext-plus-plus_1.0.0-0focal_amd64.deb\nsudo apt-get -fy install\n```\n\u003e **Note**\n\u003e In the first of the two commands above, change the path to that of the package you have downloaded.\n\n\u003e **Note**\n\u003e If the first command produces one or more \"*Package \u0026lt;name\u0026gt; is not installed*\" errors, you can safely ignore them.\nThe second command fixes these errors.\n\n(3) Run *pdftotext++* (type `pdftotext++ --help` to see the full usage information):\n```\npdftotext++ [options] \u003cpdf-file\u003e \u003coutput-file\u003e\n```\n\n### Build from source\n\n(1) Clone the project and run the install script:\n```\ngit clone git@github.com:ad-freiburg/pdftotext-plus-plus.git\ncd pdftotext-plus-plus\nsudo make install\n```\n\n(2) Run *pdftotext++* (type `pdftotext++ --help` to see the full usage information):\n```\npdftotext++ [options] \u003cpdf-file\u003e \u003coutput-file\u003e\n```\n\n## Resources\n\n* See the [documentation](https://pdftotext.cs.uni-freiburg.de) for a technical reference of *pdftotext++*. It contains descriptions of all available classes, modules, methods and arguments.\n* TODO: changelog\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad-freiburg%2Fpdftotext-plus-plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fad-freiburg%2Fpdftotext-plus-plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad-freiburg%2Fpdftotext-plus-plus/lists"}