This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Converting PDF into other formats
RGhost has a “utility“ class for converting PDF documents to other formats. The options from Document#render and
RGhost::Engine#render are used for the Convert#to method. Example:
preview = RGhost::Convert.new('/my/dir/file.pdf')
preview.to :png, :multipage => true, :resolution => 72 #returns an Array of Files
The :range option can be used to convert only a subset of a multipage file. Example, returns an Array of Files:
pages = RGhost::Convert.new('/tmp/test.pdf').to :jpeg, :multipage => true, :range => 5..6
Only the first page
thumb = RGhost::Convert.new('/tmp/test.pdf').to :png #returns File
Checking for errors
thumb = RGhost::Convert.new('/tmp/test.pdf')
out = thumb.to :png #returns File
if thumb.error
raise Exception.new “Image error”
else
File.cp(out,”/my/dir”)
end






