function IsAnnotationObjectSubtypeSupported(Subtype: TPdfAnnotationSubtype): Boolean;
| Subtype | TPdfAnnotationSubtype. Subtype to test: anUnknown, anText, anLink, anFreeText, anLine, anSquare, anCircle, anPolygon, anPolyLine, anHighlight, anUnderline, anSquiggly, anStrikeout, anStamp, anCaret, anInk, anPopup, anFileAttachment, anSound, anMovie, anWidget, anScreen, anPrinterMark, anTrapNet, anWaterMark, anThreed, anRichMedia, anXfaWidget, anRedact |
| Result | Boolean. True when the module supports that subtype for object-level handling. |
Object-level companion of IsAnnotationSubtypeSupported. Where that call reports whether a subtype can be created by CreateAnnotation, this one asks the module whether it supports handling objects of that subtype — the query that governs the annotation-object APIs such as AnnotationObjectInfo and AnnotationObjectCount, which read and edit the page objects drawn inside an annotation
The answer varies between PDFium builds. Testing first lets an application enable or disable an object-level editing feature up front instead of failing later on the actual call
When the loaded PDFium build does not export the native query (FPDFAnnot_IsObjectSupportedSubtype) the result is False, which keeps a caller on the conservative side
if Pdf1.IsAnnotationObjectSubtypeSupported(anStamp) then
BtnEditStampObjects.Enabled := True
else
// no object-level stamp editing on this PDFium build
BtnEditStampObjects.Enabled := False;