We're sorry AsposeCloud doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.cloud

WordsApi#convert_document returns a String when using 22.3 and above release

Hello, we are trying to make a request to convert a docx to pdf using the 22.3 and above release but do not get a file back as the response. A string is returned when invoking convert_document which does not respond to path. In prior releases (22.2 and below) this was not an issue.

Looking into the generated sdk, it looks like the return type for convert_document is a File.

Is there a reason that convert_document returns a String instead of a File in 22.3 and up?



The convert_document returns the output file as a ‘File’ object and you can save the output to the local drive using the Aspose.Words Cloud SDK for Ruby 22.7 as follows. However, if there is a difference in my understanding and your question, then please share some more details with the sample code.

require 'aspose_words_cloud'

class Document

  include AsposeWordsCloud

  # Get Client ID and Secret from https://dashboard.aspose.cloud/
  Client_ID = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx"
  Client_Secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  FILE_PATH = "C:/Temp/"

  def initialize
    AsposeWordsCloud.configure do |config|
      config.client_data['ClientId'] = Client_ID
      config.client_data['ClientSecret'] = Client_Secret
    @words_api = WordsApi.new

  # Convert local file
  def test_convert_document
      request_document = File.open('C:/Temp/OutputDoc.docx')
      request = ConvertDocumentRequest.new(document: request_document, format: 'pdf')
      result = @words_api.convert_document(request)
	  File.open('test_result.pdf', 'wb').write(result)
      puts "File Converted......"	  	  	  

document = Document.new()