Client-Side PDF Download Performance Issue in Safari

Hi Team,

We are observing a noticeable performance difference in client-side PDF generation between Safari and Chrome.

Use Case

We have an AI modal with a “Download PDF” feature. The PDF is generated on the client side using HTML content from the modal.

Observation Chrome: PDF generation completes in ~1–2 seconds Safari: Same flow takes ~25–30 seconds Additional Details

The functionality works correctly in both browsers, and the PDF downloads successfully. The issue is mainly the increased processing time in Safari.

The modal content may include:

  • Large formatted text
  • Markdown/code blocks
  • Images/styled UI

We suspect the delay may be related to Safari’s handling of:

  1. Canvas rendering
  2. DOM-to-image conversion
  3. Blob/PDF generation
  4. Font/image processing

Libraries/approaches involved:

  1. html2canvas
  2. jsPDF
  3. window.print() (in some cases)
  4. Question

Is this considered expected behavior in Safari/WebKit for client-side PDF generation?

Has anyone found effective Safari-specific optimizations or best practices to improve performance for this use case?

Thanks in advance.

You might be able to use Safari Web Inspector Timelines tab to take a recording during the PDF generation process to identify which calls take a lot of time.

https://webkit.org/web-inspector/timelines-tab/

Client-Side PDF Download Performance Issue in Safari
 
 
Q