procedure ReadCurrentPageLinks(MaxLinksPerKind: Integer; out AnnotationLinks: TLinkAnnotations; out TextLinks: TWebLinks; out Limited: Boolean);
| MaxLinksPerKind | Integer. Maximum number of links returned per kind; must be positive or the call raises EPdfError |
| AnnotationLinks | TLinkAnnotations. Native link annotations of the current page, at most MaxLinksPerKind entries |
| TextLinks | TWebLinks. URLs auto-detected in the page text, at most MaxLinksPerKind entries |
| Limited | Boolean. True when either kind had more links than the cap allowed |
Reads both link kinds of the active page in one call under the render lock: AnnotationLinks enumerates the native link annotations, while TextLinks loads the text page's auto-detected URLs. The cap applies to each kind separately, so a page with many annotations and few URLs returns up to MaxLinksPerKind of each
The cap bounds both native enumeration and Pascal-side materialization: annotation enumeration stops at the limit instead of walking the full list, and a text link count above the cap is truncated before the records are built. Limited is the union of both overflow flags — re-read with a higher cap or page through the unbounded LinkAnnotation property when it is True
Unlike the cached LinkAnnotation and WebLink properties, this method reads fresh arrays on every call and stores no cache; annotation handles inside the records stay valid while the page remains active
PDFium detects text links across the whole page before their count is available, so the text kind pays its full detection pass even when the cap truncates the returned records
var AnnotationLinks: TLinkAnnotations; TextLinks: TWebLinks; Limited: Boolean;
Pdf.ReadCurrentPageLinks(256, AnnotationLinks, TextLinks, Limited);
if Limited then
FlagPageForManualLinkReview;