Error while adding a stamp to a PDF file

Greetings,
I have a PDF document to which I try to add a stamp in C# .net. I use the following code:
public static void ToPdf(string sourcePath, string targetPath)
{
using (var inputStream = new MemoryStream())
{
using (var fileStream = File.Open(sourcePath, FileMode.Open, FileAccess.ReadWrite))
fileStream.CopyTo(inputStream);

    var pdfAndMark = Converter.AddTextSignatureMark(inputStream);

    using (var file = File.OpenWrite(targetPath))
      pdfAndMark.WriteTo(file);
  }
}

public static MemoryStream AddTextSignatureMark(MemoryStream inputStream)
{
  var fileStamp = new PdfFileStamp();
  fileStamp.BindPdf(inputStream);

  // Create stamp.
  var stamp = new Aspose.Pdf.Facades.Stamp();
  stamp.BindLogo(new FormattedText("Привет Мир!", System.Drawing.Color.Blue, System.Drawing.Color.Gray, 
    "Arial", EncodingType.Winansi, true, 14));
  stamp.SetOrigin(200, 200);
  stamp.Rotation = 90.0F;
  stamp.IsBackground = false;

  // Add stamp to PDF file.
  fileStamp.AddStamp(stamp);

  fileStamp.Save(inputStream);
  return inputStream;
}

When saving the stamp, the following error occurs: System.NullReferenceException
at #=zgbtT3rVhg4sFrjHBp8AwOpk_n_gLdW4aow==.#=z1m8J$5_4rzVI()
at #=ze3HhrpNw0FcWIg0OsHE_qHNLDqW0xQGb3qNwanwv9Pl_Qkf7mg==.#=zDVX35f4=(#=zc_Iw$jN6VZ3CeoK8_qFF2CPFrOL472ExdxD3ZIwA56PI #=zNdyF0Y5A9TXB, #=zzVjo1F9wNoksFXH0KKuyBRHl4H6qAEmxexKIt0Q= #=z_35j5m6zSpwt)
at #=zLX3rjC2LWig0kZbz8z1qIykvTFFA4VeHSg==.#=zhYISuIQ=()
at #=z3bg7cjd_n02zNADmEt5UJZy5IsK7DJ1_sw==.#=zDVX35f4=(Stream #=zgNPmvvI=)
at #=zoAGB0R8vth5WAKLRxknoJ5RGKC7q.#=zDVX35f4=(Stream #=zgNPmvvI=)
at Aspose.Pdf.Document.#=zaQMY1WxSvSde(Stream #=z_scZQvM=, SaveOptions #=zVOKmEcCtwEbL)
at Aspose.Pdf.Facades.SaveableFacade.Save(Stream destStream)
at Aspose.Pdf.Facades.PdfFileStamp.Save(Stream destStream)
at PdfConverter.Converter.AddTextSignatureMark(MemoryStream inputStream) in D:\Projects\master\RX\tools\PdfConverter\PdfConverter\Converter.cs:line 63

How do I convert the document correctly?

Source.pdf (228.4 KB)

@directum

We tested the scenario in our environment while using following code snippet with Aspose.PDF for .NET 20.11 and were unable to notice any issue.

Document doc = new Document(dataDir + "Вх. счет на оплату №412_3568623286_412 от 29.10.2020 от ООО _Тд _Электротехмонтаж_ _invoice-2020(v1).pdf");
Page page = doc.Pages[1];
TextStamp textStamp = new TextStamp("Привет Мир!");
textStamp.XIndent = 200;
textStamp.YIndent = 200;
textStamp.Opacity = 0.5;
textStamp.TextState.ForegroundColor = Color.Blue;
textStamp.TextState.BackgroundColor = Color.Gray;
textStamp.TextState.FontSize = 14;
textStamp.TextState.Font = FontRepository.FindFont("Arial");
textStamp.Rotate = Rotation.on90;
page.AddStamp(textStamp);
doc.Save(dataDir + "test.pdf");

Test.pdf (255.5 KB)

Would you please try using the above code snippet with the latest version of the API and in case you still face any issue, please feel free to let us know.