Define Text Box When Converting HTML to DOCX

Hello,

Is there any way to define an inline text box (that flows with the text) as part of the HTML body when using the /v4.0/words/convert endpoint?

I’m hoping there’s some sort of class I can specify (eg: <div class="inline-text-box">...</div> ) to keep the process flow simple.

Thank you!

@ohthreesixtyfive

I am afraid we do not provide any API to preprocess HTML documents. You can achieve this in two steps: first convert HTML to a Word document and later update the document margins.

Hey there!

Here I’m wondering if you can define an inline text box in the HTML before converting it to DOCX?

Appreciate any guidance!

@ohthreesixtyfive

I am afraid editing/manipulating input HTML is out of the scope of Aspose.Words Cloud in the conversion. We already offer an API method UpdateSectionPageSetup to update page setup in a section of a Word document. Please share some details about why it does not suit your requirements? So we will log a feature requirement accordingly.

Hello again,

Sorry, I think there’s some wires being crossed here. In a different thread I started I had asked about setting page margins in the HTML during conversion (which you kindly pointed out to me we do through a second API request).

My question/need here is different, though. I would like to know if I can create an HTML document where I can define a Text Box in word through a class or something similar.

For example:

<html><body>

<p>I am a basic paragraph</p>

<div class='inline-text-box' style='width: 144; height: 72;'><p>I should be an inline Text Box</p></div>

</body></html>

In the above, I’d want the first paragraph to be a standard paragraph in Word, but the second one to actually be placed within an inline Text Box in Word.

Is there some way of achieving this during conversion? And if not, what is my best path towards being able to insert a Text Box into a Word document using the API?

Cheers!

@ohthreesixtyfive

We will look into your requirements and share our findings with you.

@ohthreesixtyfive

Please check out the following article. You can insert HTML in a Word document using the MailMerge feature. Hopefully, it will help you accomplish the task.

Thanks for the response, @tilal.ahmad.

Unfortunately, I don’t think that meets my needs (unless I’m missing something).

I think what I need is something like the following:
How to insert Textbox into document using C# - Free Support Forum - aspose.com

In the above, a Text Box is created and inserted into the document (… new Shape(doc, ShapeType.TextBox) …) - I’d like to do something similar, but using the Aspose Words Cloud APIs.

I can’t seem to find an endpoint/method that enables this though.

Any insight?

@ohthreesixtyfive

Thanks for your feedback. I will appreciate it if you could please share your expected Word document. It will help us address your requirements exactly.