I generate pdf's using prawn
(and prawn-table
) and I upload them to Cloudinary via Carrierwave. However, some of these reports can get large and they raise the error:
Cloudinary::CarrierWave::UploadError: File size too large.
From here, Cloudinary supports a max of 20MB (for paid plans, which I have) for each file.
The solution I'm wanting to implement is to split the .pdf
file into two or more separate .pdf
files, depending on the size. How would I go about that using prawn
? There really isn't a way to find out how big the file will be before I generate it, right?
If prawn
can't do it, is there another gem out there that can?