Skip to main content

A macOS PDF Service to merge letterhead with printed documents

Project description

Mac-letterhead

A macOS PDF Service that automatically merges a letterhead template with printed documents.

Installation

Install the package:

uv pip install -e .

Usage

Installing a Letterhead Service

To create a PDF Service for a specific letterhead template:

uv run mac-letterhead install /path/to/your/letterhead.pdf

This will create a new PDF Service named "Letterhead " in your PDF Services directory.

Using the Letterhead Service

  1. Open any document you want to print with the letterhead
  2. Choose File > Print
  3. Click the PDF dropdown button
  4. Select "Letterhead " from the menu
  5. Choose where to save the merged PDF

Version Information

To check the current version:

uv run 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.1.5.tar.gz (14.9 kB 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.1.5-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mac_letterhead-0.1.5.tar.gz
Algorithm Hash digest
SHA256 af3623ae0b0426837f5617c995b3d9380cee2bde98b897e8d46d8aec53ed5378
MD5 eadc549f1d9808a7ab2c85926140a2d4
BLAKE2b-256 b74f976f14a9cc710733cb7bd6ae170991d700c1a8c556d2e9f14c273eb7b973

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mac_letterhead-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • 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.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a8e97bad4c2e43d97425a1944a8e54588f5e0d7e2b0a704da3ab432438a1db1c
MD5 756e3d40e8ea9ad988c261d73ba13e6e
BLAKE2b-256 5efc3d6171f431c7bde64bc2593decaeec597a1414648491655b6b1067df9f04

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