Skip to main content

A macOS utility to merge letterhead with PDF documents using a drag-and-drop interface

Project description

Mac-letterhead

A macOS utility that automatically merges a letterhead template with PDF documents using a simple drag-and-drop interface.

Installation

Install the package using uv:

uv pip install -e .

Usage

Mac-letterhead provides a simple and reliable way to apply letterhead to PDF documents using a drag-and-drop application.

Creating the Letterhead Applier App

Simply install the letterhead PDF as a drag-and-drop application:

uvx mac-letterhead install /path/to/your/letterhead.pdf

This will create a droplet application on your Desktop. The application will be named based on your letterhead file (e.g., "Letterhead CompanyLogo").

You can customize the name and location:

uvx mac-letterhead install /path/to/your/letterhead.pdf --name "Company Letterhead" --output-dir "~/Documents"

Using the Letterhead Applier App

  1. Print your document to PDF (using the standard "Save as PDF..." option)
  2. Drag and drop the PDF onto the Letterhead Applier app icon
  3. The letterhead will be applied automatically
  4. You'll be prompted to save the merged document

The application combines your letterhead and document in a way that preserves both document content and letterhead design.

Using Different Merge Strategies

If you already know which strategy works best for your letterhead, you can specify it directly:

uvx mac-letterhead merge /path/to/your/letterhead.pdf "Document Name" "/path/to/save" /path/to/document.pdf --strategy overlay

Available strategies:

  • multiply: Original strategy using multiply blend mode
  • reverse: Draws content first, then letterhead on top with blend mode
  • overlay: Uses overlay blend mode for better visibility
  • transparency: Uses transparency layers for better blending
  • darken: (Default) Uses darken blend mode which works well for light letterheads with dark text/logos
  • all: Generates files using all strategies for comparison (the main output file will use the darken strategy)

Version Information

To check the current version:

uvx mac-letterhead --version

Error Logging

The tool logs all operations and errors to:

~/Library/Logs/Mac-letterhead/letterhead.log

If you encounter any issues while using the tool, check this log file for detailed error messages and stack traces.

Features

  • Easy installation of letterhead services
  • Supports multiple letterhead templates
  • Maintains original PDF metadata
  • Preserves PDF quality
  • Shows save dialog for output location
  • Proper error handling with detailed logging
  • Supports --version flag
  • Type hints for better code maintainability

Development

To install in development mode:

uv pip install -e .

Publishing a New Release

First-time Setup

  1. Create an account on PyPI if you don't have one
  2. Create an API token on PyPI:
  3. Add the token to GitHub repository secrets:
    • Go to your repository's Settings > Secrets and variables > Actions
    • Create a new secret named PYPI_API_TOKEN
    • Paste your PyPI token as the value

Publishing a Release

  1. Update the version in:

    • pyproject.toml
    • letterhead_pdf/init.py
    • letterhead_pdf/main.py
  2. Run the release script:

./tag_release.sh

This will:

  • Create a git tag for the current version
  • Push the tag to GitHub
  • Trigger the GitHub workflow to publish to PyPI

The GitHub workflow will:

  • Build the package
  • Upload it to PyPI using the configured API token
  • Make it available for installation via pip/uv

Troubleshooting

If you encounter any issues:

  1. Check the log file at ~/Library/Logs/Mac-letterhead/letterhead.log
  2. The log contains detailed information about:
    • All operations performed
    • Error messages with stack traces
    • Input/output file paths
    • PDF processing steps

License

MIT License

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

mac_letterhead-0.4.2.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mac_letterhead-0.4.2-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file mac_letterhead-0.4.2.tar.gz.

File metadata

  • Download URL: mac_letterhead-0.4.2.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for mac_letterhead-0.4.2.tar.gz
Algorithm Hash digest
SHA256 7f5d69208341f5d75ca888ae9d3f8fa36463f404205f9ed4b8ec5bf8bbc5522c
MD5 14f3d143e4f1c9cb4b7a3e170588e23c
BLAKE2b-256 a38fe8d13a8f3bccfec24ebf424ecb72bfb073635e7211a4ef69fc4bc7456f54

See more details on using hashes here.

File details

Details for the file mac_letterhead-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: mac_letterhead-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for mac_letterhead-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e595a1909d574189ece67feafedbec66923e8acc52f84c2cc90690af02cd02ac
MD5 323a953a6f15a5f2187dc4f77149a747
BLAKE2b-256 4f206658beb4f3f1615bf0cb586129b66a0aeab5dc4740727a5e303da019c8c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page