Reading on paper just feels better. It's slow. It's embedded in the physical. It allows raw notes. As a huge reader of blogs and newsletters mainly distributed on the Internet, I created New Printer to simply transform blog posts into printable PDFs.
I am now printing the blog posts I really want to read on paper and putting them in a nice binder.
New Printer is a lightweight CLI tool that converts web articles into print-ready PDFs using pandoc's robust document conversion pipeline - bringing the classic magazine aesthetic to digital content.
- Simple & Fast: Minimal dependencies, maximum performance
- Beautiful Output: Professional typography with LaTeX backend
- Two-Column Format: Classic magazine-style layout
- Multiple Templates: Article and magazine styles
- Smart Extraction: Trafilatura with readability fallback
- Image Processing: Automatic optimization for print
- Batch Processing: Convert multiple articles at once
# Convert a single article
uvx new-printer convert https://example.com/article
# With custom options
uvx new-printer convert https://example.com/article \
--font-size 11pt \
--template magazine \
--output article.pdfRequired:
- Python 3.8+
- Pandoc 3.0+
- LaTeX distribution (TeX Live recommended)
Optional:
- uv (recommended for installation)
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install new-printer as a tool
uv tool install new-printer
# Or run without installing
uvx new-printer --helppip install new-printermacOS:
brew install pandoc
brew install --cask mactex # Or mactex-no-gui for smaller installUbuntu/Debian:
sudo apt-get update
sudo apt-get install pandoc texlive-latex-recommended texlive-latex-extraWindows:
# Convert article with defaults (2 columns, 11pt font)
new-printer convert https://longform.aeon.co/essays/future-of-work
# Specify output file
new-printer convert https://example.com/article --output my-article.pdf# Magazine style
new-printer convert https://example.com/article \
--template magazine \
--font-size 10pt
# Custom font size
new-printer convert https://example.com/article \
--template article \
--font-size 12pt# Create a file with URLs
echo "https://site1.com/article1" > urls.txt
echo "https://site2.com/article2" >> urls.txt
# Convert all articles
new-printer batch urls.txt --output-dir ./articles- article: Clean, readable layout (default)
- magazine: New Yorker-style multi-column format
All templates use a 2-column layout for optimal readability.
Create a configuration file to set your preferred defaults:
# Copy the template
cp new_printer/templates/config.yaml ~/.new-printer.yml
# Edit with your preferences
editor ~/.new-printer.ymlExample configuration:
default:
font_size: "11pt"
template: "magazine"
output_dir: "~/Documents/Articles"
include_images: trueWeb Article β Content Extraction β Markdown β Pandoc β LaTeX β PDF
(Trafilatura) (Filters) (Templates)
- Extractors: Trafilatura (primary) + Readability (fallback)
- Processors: Markdown conversion, image optimization
- Templates: Custom LaTeX templates with multi-column support
- CLI: Click-based interface with rich output
# Clone the repository
git clone https://github.com/yourusername/new-printer.git
cd new-printer
# Install development dependencies
pip install -r requirements.txt
# Install in development mode
pip install -e .# Run all tests
pytest
# Run with coverage
pytest --cov=new_printer# Format code
black new_printer tests
# Lint code
flake8 new_printer tests
# Type checking
mypy new_printerfrom new_printer.extractors.trafilatura_extractor import TrafilaturaExtractor
extractor = TrafilaturaExtractor()
article = extractor.extract("https://example.com/article")
print(f"Title: {article.title}")
print(f"Author: {article.author}")from new_printer.processors.pandoc_runner import PandocRunner
runner = PandocRunner()
pdf_path = runner.convert_to_pdf(article, {
"template": "magazine",
"output": "article.pdf"
})Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Pandoc for excellent document conversion
- Trafilatura for reliable content extraction
- LaTeX for beautiful typography
- Inspired by classic magazine and newspaper layouts
The New Printer - Because sometimes the best way to read online is offline.
