{"id":26232571,"url":"https://github.com/bulletmark/pdfcmd","last_synced_at":"2025-04-22T10:41:53.928Z","repository":{"id":44380761,"uuid":"362702801","full_name":"bulletmark/pdfcmd","owner":"bulletmark","description":"Utility to perform commands on PDF files.","archived":false,"fork":false,"pushed_at":"2025-03-17T06:12:02.000Z","size":51,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-17T23:07:18.852Z","etag":null,"topics":["pdf","pypdf2"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bulletmark.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-29T05:41:30.000Z","updated_at":"2025-03-17T06:11:11.000Z","dependencies_parsed_at":"2024-06-10T05:47:08.958Z","dependency_job_id":"155ec55e-67dd-46cb-8aa2-c0c1273b9050","html_url":"https://github.com/bulletmark/pdfcmd","commit_stats":{"total_commits":15,"total_committers":1,"mean_commits":15.0,"dds":0.0,"last_synced_commit":"f3df311c89e1a2fa6145ca1370fd4655ee5320a1"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bulletmark%2Fpdfcmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bulletmark%2Fpdfcmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bulletmark%2Fpdfcmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bulletmark%2Fpdfcmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bulletmark","download_url":"https://codeload.github.com/bulletmark/pdfcmd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250222158,"owners_count":21394827,"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":["pdf","pypdf2"],"created_at":"2025-03-13T00:37:31.495Z","updated_at":"2025-04-22T10:41:53.749Z","avatar_url":"https://github.com/bulletmark.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## PDFCMD - Utility to Perform Commands on PDF Files\n[![PyPi](https://img.shields.io/pypi/v/pdfcmd)](https://pypi.org/project/pdfcmd/)\n[![AUR](https://img.shields.io/aur/version/pdfcmd)](https://aur.archlinux.org/packages/pdfcmd/)\n\nThis is a Linux command line utility to perform commands on PDF files.\nIt uses the [pypdf](https://github.com/py-pdf/pypdf) library. The\nfollowing commands are presently implemented, each as an independent\n[plugin](pdfcmd/commands).\n\nThe latest documentation and code is available at\nhttps://github.com/bulletmark/pdfcmd.\n\n## Usage\n\nType `pdfcmd` or `pdfcmd -h` to view the usage summary:\n\n```\nusage: pdfcmd [-h] {cat,help,info,pages} ...\n\nUtility to perform commands on PDF files.\n\noptions:\n  -h, --help            show this help message and exit\n\nCommands:\n  {cat,help,info,pages}\n    cat                 Concaternate selected pages of one or more PDF files\n                        into a single file.\n    help                Show help/usage for this utility.\n    info                Show PDF document information.\n    pages               Output list of page labels/numbers, or total number of\n                        pages.\n```\n\nType `pdfcmd \u003ccommand\u003e -h` to see specific help/usage for any\nindividual command:\n\n### Command `cat`\n\n```\nusage: pdfcmd cat [-h] [-o OUTFILE] [-a] ...\n\nConcaternate selected pages of one or more PDF files into a single file.\n\npositional arguments:\n  fileranges            Sequence of alternating file names and page ranges\n\noptions:\n  -h, --help            show this help message and exit\n  -o OUTFILE, --outfile OUTFILE\n                        output file, default = stdout\n  -a, --no-aliases      do not use aliases\n\nArguments are specified as a sequence of alternating file names and page\nranges:\n\n  file1 pagerange1 file2 pagerange2 ..\n\nPage ranges refer to the previously specified file and are specified in\nPython \"slice\" notation, assuming each page is like an element in a\nsequence, starting at 0.\n\nFor example, concatenate all of head.pdf, all but page seven of\ncontent.pdf, and the last page of tail.pdf, producing output.pdf:\n\n  pdfcmd cat -o output.pdf head.pdf content.pdf :6 7: tail.pdf -1\n\nA file not followed by a page range means all pages of that file, for\nexample:\n\n  pdfcmd cat chapter*.pdf \u003ebook.pdf\n\nYou can also assign a single \"alias\" character to a file at first use\nand then use that alias later as shorthand. For example, output the\nfirst page from document1.pdf, the first page of document2.pdf, then the\nremaining pages from document1.pdf and document2.pdf:\n\n  pdfcmd cat -o output.pdf a=document1.pdf 0 b=document2.pdf 0 a 1: b 1:\n\nThe alias can be any single lower or upper case letter.\n\nPage range expression examples (remember, page indices start with zero):\n      :     all pages.                   -1    last page.\n      22    just the 23rd page.          :-1   all but the last page.\n      0:3   the first three pages.       -2    second-to-last page.\n      :3    the first three pages.       -2:   last two pages.\n      5:    from the sixth page onward.  -3:-1 third \u0026 second to last.\n  The third, \"stride\" or \"step\" number is also recognized.\n      ::2       0 2 4 ... to the end.    3:0:-1    3 2 1 but not 0.\n      1:10:2    1 3 5 7 9                2::-1     2 1 0.\n      ::-1      all pages in reverse order.\n```\n\n### Command `info`\n\n```\nusage: pdfcmd info [-h] file\n\nShow PDF document information.\n\npositional arguments:\n  file        PDF file\n\noptions:\n  -h, --help  show this help message and exit\n```\n\n### Command `pages`\n\n```\nusage: pdfcmd pages [-h] [-c] file\n\nOutput list of page labels/numbers, or total number of pages.\n\npositional arguments:\n  file         PDF file\n\noptions:\n  -h, --help   show this help message and exit\n  -c, --count  just print the total count of pages\n```\n\n### Command `help`\n\n```\nusage: pdfcmd help [-h]\n\nShow help/usage for this utility.\n\noptions:\n  -h, --help  show this help message and exit\n```\n\n## Installation\n\nArch Linux users can install [pdfcmd from the\nAUR](https://aur.archlinux.org/packages/pdfcmd). Python 3.8 or later is\nrequired. Note [pdfcmd is on PyPI](https://pypi.org/project/pdfcmd/) so\njust ensure that [`pipx`](https://pypa.github.io/pipx/) is installed\nthen type the following:\n\n```\n$ pipx install pdfcmd\n```\n\nTo upgrade:\n\n```\n$ pipx upgrade pdfcmd\n```\n\n## Command Line Tab Completion\n\nCommand line shell [tab\ncompletion](https://en.wikipedia.org/wiki/Command-line_completion) is\nautomatically enabled on `pdfcmd` commands and options using\n[`argcomplete`](https://github.com/kislyuk/argcomplete). You may need to\nfirst (once-only) [activate argcomplete global\ncompletion](https://github.com/kislyuk/argcomplete#global-completion).\n\n## License\n\nCopyright (C) 2021 Mark Blakeney. This program is distributed under the\nterms of the GNU General Public License.\nThis program is free software: you can redistribute it and/or modify it\nunder the terms of the GNU General Public License as published by the\nFree Software Foundation, either version 3 of the License, or any later\nversion.\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General\nPublic License at \u003chttp://www.gnu.org/licenses/\u003e for more details.\n\n\u003c!-- vim: se ai syn=markdown: --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbulletmark%2Fpdfcmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbulletmark%2Fpdfcmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbulletmark%2Fpdfcmd/lists"}