Best practice for using the rendering service


#1

Hi,

We are using the words and cells for around 2 years now.
Currently the way we use the service is very inefficient and we want to make it better.
In order to render a pdf (or an excel), we’re doing the following steps:

  • Get the file listing of the folder.
  • If no folder exist Create the folder.
  • Populate document template with data.
  • Export the document into the specified format.
  • Remove the file.
  • Remove the folder.
    We’re doing all this steps because we don’t want the rendered documents to stay on the aspose server, we just want to use the service for the rendering part.

What is the best practice for achieving what we want?
Can’t we just get the rendered document in one call that will automatically remove the instance from the server?

Thanks,
Yishay


#2

@yishayh

Thank you for contacting Aspose Support.

You can use PUT /words/executeTemplate API or PUT /words/executeMailMerge API that let you send Template document and Data file in request’s body; and returns output document in API response. So you do not need to upload and delete input documents in separate API calls. Please check the documentation for the cURL and SDK Examples of these APIs:

  1. Populate Mustache Template with Data Online
  2. Populate MailMerge Template with Data Online

Secondly, if you are not comfortable with Aspose Cloud Storage you can use third party storage like Amazon, Azure, Dropbox etc. Please check How to Configure 3rd Party Cloud Storages article for more details.