property LinkAnnotationCount[PageNumber: Integer]: Integer; // read only
LinkAnnotationCount returns the count of subtype /Link entrées sur la page identifiée par la PageNumber argument (PDF 1.7 spec section
12.5.6.5). Unlike AnnotationCount, qui se limite à la page actuellement active et compte chaque sous-type d’annotation, cette propriété indexée vise directement n’importe quelle page et ne filtre que les annotations de lien — les entrées qui enveloppent une zone cliquable autour du texte ou des graphiques et pointent vers une destination, une URI, une action de lancement ou une action nommée
Pass PageNumber in the range 1 .. PageCount. The value is
0 when Active is False, lorsque l’index de page est invalide, ou lorsque la page ne contient simplement aucune annotation de lien. PDFiumPas expose également séparément les URL web “auto-détectées” via WebLinkCount
— elles proviennent d’une analyse de motifs textuels et ne font pas partie de LinkAnnotationCount
Use LinkAnnotation[PageNumber, Index] with indices from 0
to LinkAnnotationCount[PageNumber] - 1 to retrieve a
TLinkAnnotation record — bounding rectangle, target page number,
action type, quadrilateral points for multi-line links, and the resolved action
payload. Loading link metadata is O(n) per page; cache when iterating many
pages.
Index on most array-style indexers.WebLinkCount when implementing a unified
“clickable hotspots” overlay in a custom viewer.0 rather than raising — safe to use
inside threaded probes without enclosing try/except.
var P, I: Integer;
var Link: TLinkAnnotation;
for P := 1 to Pdf1.PageCount do
for I := 0 to Pdf1.LinkAnnotationCount[P] - 1 do
begin
Link := Pdf1.LinkAnnotation[P, I];
Memo1.Lines.Add(Format('p%d link → page %d', [P, Link.PageNumber]));
end;