Skip to content

A precise HTML-to-PDF engine that preserves layout, style, and structure—delivering clean, consistent documents every time.

License

Notifications You must be signed in to change notification settings

RazorBackRoar/Papyrus

Repository files navigation

Papyrus

CI Ruff Version License: MIT Apple Silicon PySide6

██████╗  █████╗ ██████╗ ██╗   ██╗██████╗ ██╗   ██╗███████╗
██╔══██╗██╔══██╗██╔══██╗╚██╗ ██╔╝██╔══██╗██║   ██║██╔════╝
██████╔╝███████║██████╔╝ ╚████╔╝ ██████╔╝██║   ██║███████╗
██╔═══╝ ██╔══██║██╔═══╝   ╚██╔╝  ██╔══██╝██║   ██║╚════██║
██║     ██║  ██║██║        ██║   ██║  ██║╚██████╔╝███████║
╚═╝     ╚═╝  ╚═╝╚═╝        ╚═╝   ╚═╝  ╚═╝ ╚═════╝ ╚══════╝

Smart PDF Converter for macOS Paste a URL, HTML, or plain text → Click Export PDF → Done.


✨ Features

🧠 Smart Input Detection

Papyrus automatically detects what you paste:

You Paste What Happens
<<<<<<<<<<https://example.com>>>>>>>>>> Fetches page → Extracts content → Generates PDF
<html>...</html> Renders HTML → Generates PDF
Plain text... Formats nicely → Generates PDF

🌐 URL Fetching with Reader Mode

  • Paste any URL and click Export PDF
  • Reader Mode extracts clean article content (like Safari Reader)
  • Removes ads, navigation, and clutter automatically

📄 One-Click PDF Export

  • Portrait/Landscape orientation toggle
  • US Letter size (8.5" × 11")
  • Backgrounds preserved in PDF output
  • Auto-generated filename with date

🎨 Beautiful Interface

  • Stunning dark theme with animated gradient background
  • Syntax highlighting for HTML (Dracula theme)
  • Live preview panel
  • Glow effects on buttons

⚡ Additional Features

  • 📝 Plain Text Support – Paste any text, get a formatted PDF
  • 🖱️ Drag & Drop – Drop HTML files directly
  • 💾 Save/Open – Save and open HTML files
  • 🍎 Apple Silicon Native – Optimized for M1/M2/M3/M4

🚀 Quick Start

Installation

  1. Download the latest Papyrus.dmg from

    Releases

  2. Drag Papyrus.app to /Applications

  3. First Launch (if prompted with "App is damaged"):

   sudo xattr -cr /Applications/Papyrus.app

Usage

It's simple:

  1. Paste – URL, HTML, or plain text
  2. Click – Export PDF
  3. Done – PDF saves automatically

That's it. No buttons to figure out. Papyrus detects what you pasted and handles everything.


🛠️ Development

Prerequisites

  • Python 3.13+
  • macOS 10.13+

Setup

git clone <<<<<<<<<<https://github.com/RazorBackRoar/Papyrus.git>>>>>>>>>>
cd Papyrus

## Install dependencies
pip install -r requirements.txt

## Install Playwright browser (for advanced rendering)
playwright install chromium

## Run the app
PYTHONPATH=src python -m papyrus.main

Dependencies

Package Purpose
PySide6 Qt6 GUI framework
weasyprint PDF generation engine
readability-lxml Reader Mode article extraction
beautifulsoup4 HTML parsing

Build

## Using razorbuild tools
razorbuild Papyrus

## Creates: build/dist/Papyrus.dmg

📦 Project Structure

Papyrus/
├── src/papyrus/
│   ├── core/
│   │   └── app.py          # Main application (Smart Input System)
│   ├── utils/
│   │   └── helpers.py      # Utility functions
│   └── main.py             # Entry point
├── assets/
│   ├── papyrus.png         # App logo
│   └── icons/              # App icons
├── requirements.txt        # Python dependencies
└── Papyrus.spec           # PyInstaller config

🔧 How It Works

Smart Export Flow

User pastes content


Clicks "Export PDF"


System detects content type:


┌─────────────────────────────────────┐
│ URL? (starts with http/https)       │──→ Fetch → Reader Mode → PDF
├─────────────────────────────────────┤
│ HTML? (contains <tags>)             │──→ Render directly → PDF
├─────────────────────────────────────┤
│ Plain text?                         │──→ Wrap in template → PDF
└─────────────────────────────────────┘

Technologies

  • WeasyPrint – Converts HTML to PDF with full CSS support
  • Readability – Extracts article content from web pages
  • PySide6 – Native macOS Qt6 interface
  • PyInstaller – Bundles into standalone .app

📜 License

MIT License - see LICENSE for details.

Copyright © 2026 RazorBackRoar

Contributors 2

  •  
  •  

Languages