PDFium Delphi Component Docs

IsAnnotationObjectSubtypeSupported method

Component: TPdf  ·  Unit: PDFium
Ask whether the loaded PDFium module supports handling a given annotation subtype as annotation objects

Syntax

function IsAnnotationObjectSubtypeSupported(Subtype: TPdfAnnotationSubtype): Boolean;

SubtypeTPdfAnnotationSubtype. 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
ResultBoolean. True when the module supports that subtype for object-level handling.

Description

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

Example

if Pdf1.IsAnnotationObjectSubtypeSupported(anStamp) then
  BtnEditStampObjects.Enabled := True
else
  // no object-level stamp editing on this PDFium build
  BtnEditStampObjects.Enabled := False;

See Also

IsAnnotationSubtypeSupported, AnnotationObjectInfo, AnnotationObjectCount, CreateAnnotation