A simple Python tool that adds equally spaced horizontal lines to PDF files, making them perfect for printing and handwriting
Project description
PDF Liner
A simple Python tool that adds equally spaced horizontal lines to PDF files, making them perfect for printing and handwriting and taking notes on them.
Installation
Install from PyPI (Recommended)
Install pdf-liner directly from PyPI:
pip install pdf-liner
Or using pipx for isolated installation:
pipx install pdf-liner
Install from Source
- Clone the repository:
git clone https://github.com/raideno/pdf-liner.git
cd pdf-liner
- Install using Poetry:
poetry install
Or install in development mode using pip:
pip install -e .
Usage
Once installed, you can use the pdf-liner command from anywhere:
pdf-liner input.pdf
This will create input_lined.pdf with default settings (20-point spacing, 0.25 opacity).
Specify Output File
pdf-liner input.pdf -o output.pdf
# or
pdf-liner input.pdf --output output.pdf
Customize Line Spacing and Opacity
pdf-liner input.pdf -o output.pdf -s 25 -a 0.2
# or
pdf-liner input.pdf --output output.pdf --line-spacing 25 --opacity 0.2
-sor--line-spacing: Space between lines in points (default: 20)-aor--opacity: Line opacity from 0.0 to 1.0 (default: 0.25)
Enhance Bottom Lines for Better Printing
Some printers tend to fade lines at the bottom of pages. Use the -e option to make the bottom lines thicker and darker:
pdf-liner input.pdf -e 5
# or
pdf-liner input.pdf --enhance-bottom-lines 5
-eor--enhance-bottom-lines: Number of bottom lines to enhance (default: 3, set to 0 to disable)
Add Padding Pages
Add a blank lined page after each page:
pdf-liner input.pdf -p
# or
pdf-liner input.pdf --padding
Get Help
pdf-liner -h
# or
pdf-liner --help
Parameters
- input_pdf (required) - Path to the input PDF file
- -o, --output (optional) - Path for the output file (default:
input_lined.pdf) - -s, --line-spacing (optional) - Space between lines in points (default: 20)
- -a, --opacity (optional) - Line opacity from 0.0 to 1.0 (default: 0.25)
- -e, --enhance-bottom-lines (optional) - Number of bottom lines to enhance for better printing (default: 3)
- -p, --padding (optional) - Adds a white page with lines after each page
Development
Requirements
- Python 3.9+
- Poetry
Setup Development Environment
# Install Poetry if you haven't already
pip install poetry
# Install dependencies
poetry install
# Run the tool
poetry run pdf-liner input.pdf
Build the Package
poetry build
This will create distribution files in the dist/ directory.
Publishing
The package is automatically published to PyPI when a new release is created on GitHub. The workflow uses the PYPI_API_TOKEN secret configured in the repository.
To publish manually:
poetry config pypi-token.pypi YOUR_PYPI_TOKEN
poetry publish --build
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pdf_liner-0.1.0.tar.gz.
File metadata
- Download URL: pdf_liner-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.12 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b539ab0027b616557082221cca5782ffa8ffae7cd527077545aa075943b11210
|
|
| MD5 |
a11f0b0165b3bba81db88593522d2620
|
|
| BLAKE2b-256 |
03f763b0a618b9ca54c7c133fc45daace6a297543cadb12c249bbb9d514b79b9
|
File details
Details for the file pdf_liner-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pdf_liner-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.12 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aafee1850ae7bed0b0383bfd4b62f91093555495b370f7e36f1053df1f9f9d01
|
|
| MD5 |
ea662641a2d923d320469e6f67e23300
|
|
| BLAKE2b-256 |
577ff19d2aae7f8e684cf24cb3aa477d3728628158993cb4039e8717fc505c64
|