https://github.com/multimeric/lastpdfpage
For each page number in a PDF, selects only the last page with that number, and then regenerates the PDF
https://github.com/multimeric/lastpdfpage
Last synced: 12 months ago
JSON representation
For each page number in a PDF, selects only the last page with that number, and then regenerates the PDF
- Host: GitHub
- URL: https://github.com/multimeric/lastpdfpage
- Owner: multimeric
- License: gpl-3.0
- Created: 2020-03-18T05:10:51.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-18T06:59:14.000Z (about 6 years ago)
- Last Synced: 2025-03-21T05:23:34.427Z (about 1 year ago)
- Language: Python
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LastPdfPage
Sometimes PDFs are generated for a powerpoint presentation, but then they don't work so well as PDF documents.
For example, a single slide in the presentation might be designed to show each bullet point sequentially when the
presenter clicks.
However, once this presentation is converted to a document, it becomes much harder to use because each
bullet point now has its own page.
`LastPdfPage` eliminates this problem by editing a PDF that has multiple pages with the same page number, and selecting
only the last (or first) page from each page range that has this issue.
# Installation
Simply run:
```bash
pip install git+git://github.com/TMiguelT/LastPdfPage.git
```
# CLI
```
Usage: last-pdf-page [OPTIONS] PDF
Options:
--select [first|last] Whether to choose the first, or last page for each
number
--help Show this message and exit.
```
For example, to edit a PDF and take only the last page of each page-range with the same number:
```bash
last-pdf-page --select last somePdf.pdf > fixed.pdf
```
# Python API
```python
from last_pdf_page import simplify_pdf
with open('fixed.pdf', 'wb') as fp:
simplify_pdf('somePdf.pdf', select='last', outfile=fp)
```