Page Content changed during saving

Hi all,
I redefined an Operator but when save the document, the new operator is restored to the original version. For example:

/P << MCID 1>> BDC becomes /P << >> BDC
Why?

Thanks

@SC85

Would you please share some more details like sample file and complete sample code snippet with us so that we can test the scenario in our environment and address it accordingly.

Hi Asad,

thanks for reply. Below my code:

namespace Aspose.Pdf.Operators
{
  public class BeginMarkedContent : BDC
  {
      private string tag;
  
      public BeginMarkedContent(string tag) : base(tag)
      {
          this.tag = tag;
      }
  
      public override void Accept(IOperatorSelector visitor) { }
  
      public override string ToString()
      {
          return $" /{tag} << CIU >> BMC";
      }
  }
}
//--------------------------------------------------------------

page.Contents.Add(new Aspose.Pdf.Operators.GSave());
page.Contents.Add(new Aspose.Pdf.Operators.BT());
page.Contents.Add(new Aspose.Pdf.Operators.BeginMarkedContent("P"));
page.Contents.Add(new Aspose.Pdf.Operators.SetRGBColor(color.getR(), color.getG(), color.getB()));
page.Contents.Add(new Aspose.Pdf.Operators.SelectFont(insidefontName, fontSize));
page.Contents.Add(new Aspose.Pdf.Operators.SetTextMatrix(textMatrix.M11, textMatrix.M12, textMatrix.M21, textMatrix.M22, atX, atY));
page.Contents.Add(new Aspose.Pdf.Operators.ShowText(text, font));
page.Contents.Add(new Aspose.Pdf.Operators.EMC());
page.Contents.Add(new Aspose.Pdf.Operators.ET());
page.Contents.Add(new Aspose.Pdf.Operators.GRestore());

When saving the document: 
doc.Save("example.pdf");

the /P << MCID 1>> BDC operator
becomes
/P << >> BDC

@SC85

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-56143

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.