🚀 Fix for Slow PDF Generation in SuiteCRM

I recently ran into an issue where PDF downloads in the SuiteCRM were taking several minutes to generate. After some debugging, I found the root cause and wanted to share the solution with the community.

:magnifying_glass_tilted_left: Root Cause

The delay was caused by an <img> tag in the PDF template using an HTTP URL like:

<img src="https://your-crm-domain/custom/themes/default/images/YourImage.png">

SuiteCRM uses TCPDF for PDF generation, which attempts to fetch images over HTTP/HTTPS. This introduces latency due to:

  • Network calls (even to the same server)
  • DNS resolution
  • SSL/security scanning (e.g., SentinelOne, antivirus tools)

:white_check_mark: Solution

Switch the image source to a local file path instead of an HTTP URL:

<img src="custom/themes/default/images/YourImage.png">

:light_bulb: Result

  • PDF generation time reduced from minutes → seconds
  • No more network-related delays
  • Much smoother user experience

:brain: Key Takeaway

When working with SuiteCRM PDF templates:

  • :cross_mark: Avoid HTTP/HTTPS image URLs
  • :white_check_mark: Use local file paths or base64 images

Hope this helps anyone facing similar performance issues!

Let me know if you’ve encountered other TCPDF quirks :+1:

1 Like