Joel VanderWerf
11/16/2006 11:09:00 PM
Joel VanderWerf wrote:
> Adam Groves wrote:
>> Hi Joel,
>>
>> thanks for the speedy reply! The problem is, I need to pass on a file
>> object (which has been uploaded from a web page form) to 'convert' and
>> not just a path. I should have made this clearer in my original post.
>>
>> Any ideas?
>>
>
> Untested, but maybe something like this?
>
> file = File.open("mypdf.pdf")
> IO.popen("convert -resize 700x700 pdf:-[0] png:-") do |f|
^^^^^
...this bit is the problem. So Ara's r+ pipe would be necessary, unless
you can put a filename here instead.
Also, I forgot the "w" mode.
> while (data=file.read(N))
> f.write data
> end
> end
>
--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407