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.

Answered by Developer Tools Engineer in 888391022

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/

Accepted Answer

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/

Thanks for the suggestion. I’ve attached a recording link showing the PDF generation process.

I checked the Timelines tab in Safari Web Inspector, but I’m not seeing any logs or activity there during the process. However, in the Console tab, I can see the time taken for each stage of the PDF creation and download flow.

https://drive.google.com/file/d/167FJfUQyOcbIW3mWPGqDH5duPJ7SLQxb/view?usp=drive_link

Client-Side PDF Download Performance Issue in Safari
 
 
Q