procedure AddPathToAnnotation(Index: Integer);
| Index | Integer. Zero-based index of an ink (anInk) or stamp (anStamp) annotation on the current page. Any other subtype raises EPdfError. |
Builds on the same pending path as AddPath: call CreatePath, extend it with MoveTo, LineTo, and BezierTo, then commit it here rather than to the page content
The annotation takes ownership, and a path can belong to only one annotation, so the pending path is consumed either way - on success by the annotation, on failure by being destroyed. Either outcome leaves no path pending
PDFium restricts object editing to ink and stamp subtypes, which is why any other subtype is rejected rather than silently doing nothing
Pdf.CreateAnnotation(anInk);
Pdf.CreatePath(100, 100, fmNone, clBlack, $FF, True, clBlue);
Pdf.LineTo(300, 200);
Pdf.AddPathToAnnotation(Pdf.AnnotationCount - 1);