Hi,
we use aspose words for .net. the version of is old but , we tried new version. we are making replace text in existing word doucment. During this process, high cpu problem occurs. Can you help with this? the block of code is below.
var license = new License();
license.SetLicense(HttpContext.Current.Server.MapPath("~/Content/Aspose.Words.lic"));
var dysResult = _dysService.DownloadFromServer(kullanici, evrak.Icerik.WordDokuman);
using (var mStream = new MemoryStream(dysResult.Item2.Icerik))
{
var mainDoc = new Document(mStream, new LoadOptions(LoadFormat.Docx, null, null));
if (!evrak.Sayi.IsNullOrWhiteSpace())
{
mainDoc.Range.Replace("[SAYI]", evrak.Sayi ?? āā, false, false);
}
if (evrak.Tarih != null)
{
mainDoc.Range.Replace("[TARIH]", evrak.Tarih.Value.ToString(ādā), false, false);
}
if (evrak.KonuMetni != null)
{
mainDoc.Range.Replace("[KONU]", evrak.KonuMetni, false, false);
}
if (evrak.EvrakGuid != null)
{
mainDoc.Range.Replace("[BELGEID]", evrak.EvrakGuid.ToString(), false, false);
}
using (var memoryStream = new MemoryStream())
{
mainDoc.Save(memoryStream, SaveFormat.Pdf);
ustyazi.Icerik = memoryStream.ToArray();
ustyazi.OcrText = mainDoc.GetText();
}
}