I'm breaking 10mb on renderAsPDF() causing errors ...
# suitescript
s
I'm breaking 10mb on renderAsPDF() causing errors on emails not sending out, the culprit was images with very high sizes, is there a way to script to lower the resolution of the images? Either freemarker (Advanced PDF) or within the script? Or, is my only out to create lower resolution images to be used in the pdf?
d
If it's just logos or similar, you can probably dramatically reduce file size without affecting quality using kraken.io or squoosh.app. If you need to do it ad hoc with lots of images, the former has an API.
🙌 1
💡 1
s
Definitely use an image conversion app, especially ones designed for web pages to reduce image size for fast loading. Also, try various image formats, as some images compress better with different algorithms. Some compression does not affect image quality at all, but sometimes you can lose a tiny bit of quality to gain a dramatic size reduction, which is usually the case with JPEG files.
🙌 1
💡 1
s
thank you all, i'll revert back to my client and see, great suggestions, and i'll just try to convince them 🙂