Where to store graphics (for PDF templates etc.) in an upgrade safe location?

We’re using a few graphics / logos in our PDF templates (and later Email templates).
If I just place them in the /public/ folder, they are being deleted by the Suite8 upgrade.
Where do you usually place those “manual” graphics? In the uploads folder?

You can create images folder under custom and store your images.

public/legacy/custom

It is upgrade safe.

Hi @Chris138

  1. PDF Template Graphics - Upgrade Safe Storage Solution

  2. Problem Statement

When storing graphics/images for PDF templates in SuiteCRM’s default directories (like `themes/default/images/`), they get overwritten during system upgrades, causing broken PDF templates and missing images.

  1. Root Cause

SuiteCRM upgrades replace core theme directories, removing any custom graphics stored in:

  • `themes/default/images/`
  • `themes/suite8/images/`
  • Other core theme locations
  1. Solution

Store PDF template graphics in the upgrade-safe `custom/` directory.

  1. Step 1: Create Custom Images Directory

```bash
mkdir -p public/legacy/custom/images
mkdir -p public/legacy/custom/images/logos
mkdir -p public/legacy/custom/images/headers
mkdir -p public/legacy/custom/images/footers
```

  1. Step 2: Directory Structure

```
public/legacy/custom/images/
├── logos/
│ └── company_logo.png
├── headers/
│ └── header_image.png
├── footers/
│ └── footer_logo.png
└── signatures/
└── signature.png
```

  1. Step 3: Update PDF Template Code

Before (upgrade-unsafe):
```php
$image_path = ‘themes/default/images/company_logo.png’;
```

After (upgrade-safe):
```php
$image_path = ‘custom/images/logos/company_logo.png’;
```

  1. Step 4: Implementation Checklist

- Create `custom/images/` directory structure

  • Move existing graphics from theme directories
  • Update PDF template code paths
  • Test PDF generation
  • Verify web accessibility
  1. Benefits

- Upgrade-safe: Custom directory never overwritten

  • Web accessible: Images available via URL
  • Organized: Structured subdirectories
  • Maintainable: Clear separation from core files
  1. File Paths Reference
Type Path
------ ------
undefined ----
Logos `custom/images/logos/`
undefined ----
Headers `custom/images/headers/`
undefined ----
Footers `custom/images/footers/`
undefined ----
Signatures `custom/images/signatures/`
undefined ----
  1. Testing

Verify images load correctly:

Hello Chris,

one more idea:
There are new field types from 8.9 onwards:

You can choose the:

public-images

in order to upload things to the standard folder.
It’s upgrade safe and can even be accessed by PDF templates / external systems (with the information about the path).

I like this approach, since it has got a modern UI and users can upload and use files by themselves.