I have a PDF file, It contains multiple HyperLink, I want to remove Link Annotation Using Aspose.PDF for NET, But i found that if the Link Annotation text is a HyperLink, Aspose can’t remove it’s Link Annotation.More detail can see the demo.pdf file.
Version info:Aspose.PDF for Net 22.12
The demo code:
var doc = new Aspose.Pdf.Document(@"C:\demo.pdf");
doc.Pages.ToList().ForEach(page =>
{
page.Annotations.ToList().ForEach(annotation =>
{
if (annotation.AnnotationType == AnnotationType.Link)
{
page.Annotations.Delete(annotation);
}
});
});
doc.Save(@"C:\output.pdf");
The demo file:
demo.pdf (33.6 KB)
The output file:
output.pdf (32.2 KB)