Method: Metodos.pagesize
- Defined in:
- lib/imposition/metodos.rb
.pagesize(pdfinfo) ⇒ Object
tamaño de pagina
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/imposition/metodos.rb', line 136 def self.pagesize(pdfinfo) info = pdfinfo.chomp busca = /Page size\s*\:\s*([\d\.]+)\s*x\s*([\d\.]+).*/ pags = busca.match(info) retorno=Hash.new splitted=pags[0].split(" ") unidad=splitted[5] #unidades pdfinfo 2 alchemist if unidad=="pts" then unidad="point" #TODO elsif... else#default unidad="point" end retorno["unidad"]=unidad #con unidad retorno["ancho"]=pags[1].to_f.send(unidad) retorno["alto"]=pags[2].to_f.send(unidad) if splitted[6]!=nil then retorno["nombre"]=splitted[6].delete("(").delete(")") end return retorno end |