0

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?

Ryan K
  • 3,985
  • 4
  • 39
  • 42
  • @Itay I don't need thumbnails or transformations. Simple storage and retrieval via Cloudinary. – Ryan K Aug 08 '16 at 18:38
  • And how large do you estimate your PDF files size to reach to? – Itay Taragano Aug 08 '16 at 21:49
  • @ItayTaragano Not sure. The PDF I generated was the worst-case scenario right now (but I don't know exactly how big that was), but as the data set grows, it could get much worse. However, I'm ok with splitting up the report into as many sections as needed. – Ryan K Aug 08 '16 at 22:00
  • Please feel free to continue this conversation with us on support@cloudinary.com. As these files are used for storage only, we may be able to offer an alternative. – Itay Taragano Aug 09 '16 at 06:18

0 Answers0