Lee Foot

PDF Branding Injector

Add a branded header band with your website and phone number to the first page of every PDF in a folder.

Launch the app → View the source

#about

Adds a coloured header band with your website and phone number to the first page of each PDF.

The first page is made 30 points taller so the band sits above the original content, and later pages are copied through unchanged.

A Python script processes a folder and its subfolders and mirrors the structure in the output.

The font in TEXT_FONT must load from FONT_PATH or be a ReportLab built-in, or every file fails.

Streamlit app

Platform
Browser-based (no installation required)
Input
PDF filesBranding info (phone, website)
Output
Branded PDFs with custom headers
Category
E-commerce

Use cases

  • Branding supplier product datasheets
  • Adding contact info to manufacturer PDFs
  • Creating consistent downloadable documentation

#features

  • Header added to the first page only, with the page extended so content is not covered
  • PyPDF2 + ReportLab header merging
  • Responsive text scaling by page width (10-14pt)
  • Recursive directory processing mirroring subfolder structure
  • Custom TTF font (a valid FONT_PATH or built-in font name is required)
  • Hex colour configuration for text and background
  • Optional filename suffix and date appending (off by default)

#how-to-use

  1. Place PDFs in INPUT_DIR
  2. Configure FONT_PATH, PHONE_NUMBER, WEBSITE
  3. Set TEXT_COLOR and BACKGROUND_COLOR (hex)
  4. Run script with progress tracking
  5. Collect branded PDFs from OUTPUT_DIR

#faq

Does the header appear on every page?
No, only on the first page of each PDF. The tool creates a new first page that is 30 points taller than the original (SPACE_HEIGHT), draws the coloured header band in the new space, then places the original content below it, so nothing is covered up. All remaining pages are copied through unchanged, which means page one of the output is slightly taller than the rest of the document.
Every PDF fails with an error. What is the usual cause?
An invalid FONT_PATH. The header is drawn with the font name in TEXT_FONT, which must be registered from the TTF file at FONT_PATH. If registration fails, the script prints a warning claiming a default font will be used, but drawing then fails for every file because the font name was never registered. Either fix the path to a real .ttf file or change TEXT_FONT to a ReportLab built-in such as Helvetica.
What exactly goes in the header?
A single centred line in the format 'website - phone number' (WEBSITE and PHONE_NUMBER constants) on a solid background band. Text and band colours are hex constants (TEXT_COLOR, BACKGROUND_COLOR). Pages within 10pt of the 612pt letter width get TEXT_FONT_SIZE (14pt); other widths get 14pt scaled by page width relative to 612pt, clamped between 10pt and 14pt.
How does it handle folders of PDFs?
It walks INPUT_DIR recursively, processes every .pdf found, and recreates the same subfolder structure under OUTPUT_DIR. Output filenames are identical to the input unless you flip APPEND_SUFFIX or APPEND_DATE to True (both default to False). A file that errors is warned and skipped; the run continues.

/contact

Want me to run this for you? I run this tool as a managed service, or build something custom around your data. You get the insights without touching the code.