Module: WPS

Defined in:
lib/wps.rb

Class Method Summary collapse

Class Method Details

.doc2pdf(doc_file, pdf_file) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/wps.rb', line 3

def doc2pdf(doc_file,pdf_file)
  begin 
    wps=WIN32OLE.new("wps.application")
    doc=wps.Documents.open(File.expand_path(doc_file))
    doc.ExportPdf(File.expand_path(pdf_file))
    doc.Close
  
  ensure 
    wps.Terminate
  end  
end