I want to to Remove Hyperlink from PDF using Aspose.PDF 24.4, But it doesn’t work.
Sampe Code
void Main()
{
InitCoreComponent();
var doc = new Aspose.Pdf.Document(@"C:\Users\54390\Downloads\removePDFLink\input.pdf");
var page = doc.Pages[1];
Console.WriteLine(page.Annotations.Count);
page.Annotations.ToList().ForEach(annotation =>
{
if (annotation.AnnotationType == Aspose.Pdf.Annotations.AnnotationType.Link)
{
page.Annotations.Delete(annotation);
}
});
doc.Save(@"C:\Users\54390\Downloads\removePDFLink\output.pdf");
}
Demo fIle
removePDFLink.zip (1.9 MB)