Member 11644311 Ответов: 0

Как удалить эффект наведения курсора мыши на аннотацию PDF link с помощью itextsharp / iText?


I have hard time to remove link annotations with its text styles from pdf.


Что я уже пробовал:

However, I was able to replace link action using the following code.


Annots = PageDictionary.GetAsArray(PdfName.ANNOTS);
if ((Annots == null) || (Annots.Length == 0))
{
  continue;
}
foreach (PdfObject A in Annots.ArrayList)
{
    PdfDictionary AnnotationDictionary = (PdfDictionary)PdfReader.GetPdfObject(A);

    if (!AnnotationDictionary.Get(PdfName.SUBTYPE).Equals(PdfName.LINK))
    {
      continue;
    }
    if (AnnotationDictionary.Get(PdfName.A) == null)
    {
        continue;
    }

    PdfDictionary AnnotationAction =(PdfDictionary)AnnotationDictionary.GetAsDict(PdfName.A);
    if (AnnotationAction.Get(PdfName.S).Equals(PdfName.URI))
    {
        AnnotationAction.Remove(PdfName.S);
        AnnotationAction.Remove(PdfName.URI);
        AnnotationAction.Put(PdfName.S, PdfName.GOTO);
    }
}



But still, mouse over/click effects and link underline remain the same.

How can I remove all link text styles and mouse actions of annotation?

0 Ответов