class Bazuro::Pdf2docx
Attributes
docname[RW]
docx[RW]
pdf[RW]
Public Class Methods
new(pdf)
click to toggle source
# File lib/bazuro.rb, line 18 def initialize(pdf) @pdf = pdf @docx = nil @docname = nil end
Public Instance Methods
convert(path = Bazuro.config["local"]["temp_path"])
click to toggle source
# File lib/bazuro.rb, line 40 def convert(path = Bazuro.config["local"]["temp_path"]) @docname = @pdf.split('/').last.gsub(".pdf", ".docx") @docx = "#{path}/#{@docname}" system("cd #{path} && #{Bazuro.config["local"]["winword_path"]} /mPDF2DOC /q #{@pdf}") end
request()
click to toggle source
# File lib/bazuro.rb, line 24 def request RestClient::Request.new( :method => :post, :url => Bazuro.config["remote"]["url"], :user => Bazuro.config["remote"]["username"], :password => Bazuro.config["remote"]["password"], :payload => { :file => @pdf } ).execute end
test()
click to toggle source
# File lib/bazuro.rb, line 36 def test end