@dcdeveloper
Thanks for sharing requested details.
We have tested the scenario in our environment using following code snippet and observed that there are two annotations added in the shared PDF document. The popup was not associated with the RedactionAnnotation
- instead it has been added separately inside PDF. If you execute below code snippet, you will notice that it will return two annotations (i.e RedactionAnnotation
and PopupAnnotation
) . Annotations.png (1.6 KB)
In case you want to remove the popup from your PDF, you may delete it using Page.Annotation.Delete()
method. We have removed popup from your PDF document using following code snippet. For your kind reference, an output PDF has also been attached.
int i = 0;
Document doc = new Document(dataDir + "sample_redaction_annotation.pdf");
foreach (Annotation annotation in doc.Pages[1].Annotations)
{
i++;
Console.WriteLine("Iteration # : " + i.ToString());
Console.WriteLine("AnnotationType : " + annotation.AnnotationType.ToString());
if (annotation.AnnotationType == AnnotationType.Popup)
{
doc.Pages[1].Annotations.Delete(annotation);
}
Console.WriteLine("*********************");
}
doc.Save(dataDir + "sample_redaction_annotation_out.pdf");
sample_redaction_annotation_out.pdf (27.6 KB)
Furthermore, we have also observed that while accessing PopupAnnotation.Parent
property, System.InvalidCastException
Exception occurred. For the sake of investigation we have logged this issue as PDFNET-44181 in our issue tracking system. We will further look into the details of the logged issue and keep you posted with the status of its rectification. Please be patient and spare us little time.
We are sorry for the inconvenience.