Hi,
I'm trying to do something where I upload a PDF file to my Rails
application, and the uploader splits the PDF into N files, one image
file for each page. I can do this trivially with Rmagick by itself by
just making an ImageList with the PDF and then saving the individual
pages, but now I'm wondering what the "right" way to do this using
CarrierWave would be. Should I be using manipulate! somehow? This bug
report seems to indicate that it should be possible, but it doesn't
seem to do anything for me.
https://github.com/jnicklas/carrierwave/pull/691
I tried doing this in my uploader:
process :split
def split
manipulate! do |img, index|
img = yield(img) if block_given?
img
end
end
not really knowing what I'm doing, but this didn't really do anything
for me. Should I just call img.write(whateverfilename) in manipulate,
or is there a better way? I thought it would be convenient if each
page was saved as a version but I can't call version inside the
manipulate!'s block. Apologies for severely abusing programming
paradigms I'm sure,
-Ibrahim