How to get Mail Merge Word document result as PDF in PHP with Aspose.Words REST API

Hi!

We have a template on our server and wants to merge this with a dataset. The output needs to be PDF. What is the easiest way of doing this? I have read previous posts and documentation and not sure what best practice is.

Is it possible to do the merge (not mergeonline) and get the PDF returned in one request?

In this old post it wasn’t possible. Merging Word documents and converting to PDF - Free Support Forum - aspose.com Still the same?

Do we have to 1) merge (where the output is saved on your server), 2) convert to pdf (again where the output is saved on your server), 3) download to our server and 4) delete the files from Asposes server? When I read the documentation it looks like this is how we need to do it.

Fx using

  1. ExecuteTemplateTests.php
  2. ConvertDocumentTests.php
  3. DownloadFile.php
  4. DeleteFile.php

Also what is the difference between executeTemplates and ExecuteMailMerge? Is it that ExecuteMailMerge uses Words Mailmerge fields and executetemplate uses {{placeholders}} as placeholders and it is possible to handle Merge Blocks(Loops on objects).

If we also would like to do merge with images which would you recommend

BR

@Sophus

Is it possible to do the merge (not mergeonline) and get the PDF returned in one request?

Unfortunately, at present, you can’t merge and save the output file as PDF in one request. I have logged the request (WORDSCLOUD-364) for the implementation of this feature and will update you here once the feature is implemented.

Do we have to 1) merge (where the output is saved on your server), 2) convert to pdf (again where the output is saved on your server), 3) download to our server and 4) delete the files from Aspose server? When I read the documentation it looks like this is how we need to do it.

It is not necessary you use Aspose Cloud Storage as Storage Provider, you can use third-party storage like Amazon, Dropbox, Azure or Google Drive as Storage Provider. Please check this article for more details.

Also what is the difference between executeTemplates and ExecuteMailMerge? Is it that ExecuteMailMerge uses Words Mailmerge fields and executetemplate uses {{placeholders}} as placeholders and it is possible to handle Merge Blocks(Loops on objects).

If we also would like to do merge with images which would you recommend

executeMailMerge is used for both Mail Merge templates and Mustache Templates. It supports merging images as well.

Hi @sohail.aspose

Thanks for your reply.

I have looked at the article. Could you consider adding support of Digital Ocean Spaces? DigitalOcean have developed their API compatible with S3. /reference/api/spaces-api/

BR

@Sophus

I have logged the request (BILLING-3928) for our Platform team for the integration of DigitalOcean with Aspose Cloud Storage. I will update you here once I have feedback from the Platform team.

The issues you have found earlier (filed as WORDSCLOUD-364) have been fixed in this update. This message was posted using Bugs notification tool by Ivanov_John