There was an error displaying

The document is transferred to the system, an error occurred when viewed as pdf
I attached the original file and corrupted file. We are using Aspose.Word 21.1 version. Thanks.
YG13821

@srmbimser,

After an initial test with the licensed latest (21.1) version of Aspose.Words for .NET, we were unable to reproduce this exception with any of your four documents on our end.

Please also create a standalone simplified Console application (source code without compilation errors) that helps us to reproduce this problem on our end and attach it here for testing. Please do not include Aspose.Words DLL files in it to reduce the file size. Does Aspose.Words throw this exception for all these four documents on your end?

We will then start further investigation into this scenario and provide you more information.

You can download the application that you can test the error from the link.
Select the file to upload, click Upload button. Error occurs during replace operation
The same error is encountered in all of the attached documents.
YG13823.zip (876.3 KB)

Test Application Link

@srmbimser,

I am afraid, I am still unable to reproduce this exception even when using the project you supplied. The following code produces PDF files without any exception (I have checked all your source Word documents):

Document doc = new Document(@"C:\Temp\input.docx");
ReplaceEvaluatorFindText replaceElement = new ReplaceEvaluatorFindText();
System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("<DOC_ADI>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
FindReplaceOptions options = new FindReplaceOptions(replaceElement);
options.Direction = FindReplaceDirection.Forward;
doc.Range.Replace(regex, "Test Document Name", options);
doc.Save("C:\\Temp\\YG13821\\21.1.pdf");

public class ReplaceEvaluatorFindText : IReplacingCallback
{
    public bool contain = false;
    ReplaceAction IReplacingCallback.Replacing(ReplacingArgs e)
    {
        contain = true;
        return ReplaceAction.Stop;
    }
}

I have noticed your project is referencing old 18.12 version of Aspose.Words for .NET. Can you please upgrade to 21.1 version and see how it goes on your end?