The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Good day all,
I'm having a heck of a time trying how to add text programmaticly. I have tried appendtext, insert, EditLocation and can not seem to build a text file dynamically. Could someone please point me in the right location. I'm sure i'm just missing a simple method or property setting.
Thanks,
Dennis
ADAdministrator Syncfusion Team July 14, 2003 03:41 PM UTC
Hi Dennis,
There are several ways in which to dynamically add text to the EditControl.
First, there is the Insert() method of the EditControl, which has five overrides. The simplest one just takes a string as its single parameter. The other overrides for Insert take an EditLocation. If you specify a location that does not exist (e.g. Line 5 character 6 when there is only one line in the file), the insertion will fail. To perform this, you would need to create blank lines first.
The other way to modify the text would be by setting the Text property of the control.
Also, make sure that you have called NewFile() if you wish to create a blank document. Without this call (or without loading up a file), none of the text functions will work, since there will not be any content to modify.
I hope this helps.
Thanks, and have a great day!
Syncfusion Technical Support