Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Feb 18, 2025 7:07 am

We need to dynamically replace a text in a text box in a document (see sample file in the attachment).
If the text is very long, the corners are more rounded (radius is larger).
Is it possible to reset the rounding to the initial value after replacing the text?

Ist this possible with Spire.Doc.10.3.5?

softecregistrierung
 
Posts: 24
Joined: Mon Mar 07, 2011 9:35 am

Tue Feb 18, 2025 9:01 am

Hi,

Thanks for your inquiry.
Your example document contains a RoundRectangle shape. We apologize that our Spire.Doc currently does not provide an interface to directly obtain or adjust the radius of the shape. Our dev team will conduct an investigation, and we will notify you promptly if we provide further support.
Additionally, using the following code to directly replace the text in your document will not result in changes to the rounded corners of the rectangle.
Code: Select all
Document document=new Document();
document.LoadFromFile("Example.docx");

// Replace text with long text
document.Replace("TEXT", "Spire.Doc for .NET is a professional Word .NET library specifically designed for developers to create, read, write, convert, compare and print Word documents on any .NET platform (Target .NET Framework, .NET Core, .NET Standard, .NET 5.0, .NET 6.0, Xamarin & Mono Android) with fast and high quality performance.", true, false);

document.SaveToFile("Result.docx", FileFormat.Docx2013);

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1320
Joined: Tue Sep 27, 2016 1:06 am

Wed Feb 19, 2025 12:38 pm

In my example document, 'Auto adjust to text' was not set. From my point of view, it does not work if this is set.

softecregistrierung
 
Posts: 24
Joined: Mon Mar 07, 2011 9:35 am

Thu Feb 20, 2025 3:04 am

Hi,

Thanks for your feedback.
I understand your situation now. I have created a new feature to support obtaining and modifying rounded corners. I will notify you promptly if the feature is implemented.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1320
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.Doc