The invocation of page.Artifacts.Delete(artifact) throws an exception

pdf.pdf (317.4 KB)
for (int i = 1; i <= page.Artifacts.Count; i++)
{
var artifact = page.Artifacts[i];
switch (artifact.Subtype)
{
case pdf.Artifact.ArtifactSubtype.Header:
case pdf.Artifact.ArtifactSubtype.Footer:
case pdf.Artifact.ArtifactSubtype.Watermark:
page.Artifacts.Delete(artifact);
break;
}
}
throw:Page contents was changed after reading artifacts on page.

The above code works fine for many files, but throws an error for this specific document!

@xhuigy
Thank you for writing, the problem is present, I set the task for the development team.

@xhuigy
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-54665

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.