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

Free Support Forum - aspose.cloud

PHP Create a new document from a template and insert HTML

This post: https://forum.aspose.com/t/how-to-create-template-document-using-aspose/120045/3 suggests that it is possible to create a new document based on a dotx template.

However, PHP API only accepts the new filename as a parameter:

$createRequest = new CreateDocumentRequest(
    "Sample.docx", NULL, NULL);

How do I create a new document based on a dotx template (which is stored in my online storage)?

I then need to append some html formatted text - other APIs seem to have a builder object:

builder.InsertHtml("<b>Format this as bold</b>")

but the PHP API doesn’t.


We have logged a ticket (WORDSCLOUD-2318) for further investigation.

You can use the mail merge feature to insert HTML text into a document. Please check the following post for an idea. You can use the sample template and data to test the feature. Hopefully, it will help you accomplish the task.