Convert Word documents to other formats without using Storage (RUBY REST)

Skip to end of metadata
Go to start of metadata
This example allows you to convert MS Word documents to other formats without uploading documents to any storage using Saaspose.Words REST API in your RUBY applications.
We're referring to the following common methods to perform general operations:


begin
require_relative 'saaspose_common'

appSID = '77****************'
appKey = '89***************'
Common::SaasposeApp.new(appSID,appKey)

filePath = 'C:/Sample.doc' 
fileName = File.basename(filePath)

#build URI to convert to PDF 
strURI = 'http://api.saaspose.com/v1.0/words/convert?format=pdf' 

#sign URI 
signedURI = Common::Utils.sign(strURI)
responseStream = RestClient.put(signedURI,File.new(filePath, 'rb'),{:accept=>"application/xml"})
Common::Utils.saveFile(responseStream, fileName + '.pdf')
p fileName
rescue Exception=>e
print e
end 
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.