THPDFPage Advanced Methods

This page lists advanced public THPDFPage methods used in specialised authoring workflows and compatibility code

Markup and Rich Annotations

Method Use
AddHighlightAnnotation, AddUnderlineAnnotation, AddSquigglyAnnotation, AddStrikeOutAnnotation Create text markup annotations over a rectangular text range. HotPDF emits the matching PDF 1.7 subtype and derives /QuadPoints from the rectangle
AddPolylineAnnotation, AddPolygonAnnotation Create PDF 1.7 polyline or polygon review annotations from an array of THPDFCurrPoint vertices. The overloads with THPDFPolyExtras add optional interior colour, cloudy border, intent, and line-ending details
HPDFDefaultLineExtras, HPDFDefaultPolyExtras Return zero-initialised THPDFLineExtras and THPDFPolyExtras records so callers can set only the optional line or polygon annotation fields they need
AddInkAnnotation, AddCaretAnnotation Add freehand review markup or caret insertion markers. Use LastAnnotation with SetAnnotationBorderStyle when border styling must be adjusted after creation
AddScreenAnnotation, AddWatermarkAnnotation, AddRedactAnnotation Add multimedia screen, fixed-print watermark, or redaction annotations. These methods follow the same PDF version and compliance gates as the corresponding annotation subtypes
Add3DAnnotation, AddRichMediaAnnotation Add PDF 1.7 interactive media annotations. These are intended for viewer workflows that explicitly support embedded 3D or rich-media content and are not suitable for archival PDF/A output
AddPopupAnnotation Create a popup annotation directly. When the popup should be attached to another annotation, prefer AddPopupAnnotationFor

Button Action Extensions

Method Description
AddPushButtonWithHideAction Create a push button whose action hides or shows one or more form fields. This is useful when a form needs optional sections without running JavaScript
AddPushButtonWithSubmitAction Create a submit button with explicit THPDFSubmitFormFlags so the caller controls FDF, HTML, XFDF, PDF, GET/POST, and related submission options
AddPushButtonWithRenditionAction Create a push button that controls a Rendition action bound to a Screen annotation and a media file. PDF/A and PDF/X compliance modes reject multimedia actions
AddPushButtonWithSoundAction Create a push button that plays an embedded PDF /Sound. Overloads accept either a file name or caller-supplied raw sound bytes with THPDFSoundParams
AddPushButtonWithMovieAction Create a legacy Movie action button that references the dictionary returned by AddMovieAnnotation

Page Boxes and Display Controls

Method or property Description
SetCropBox, SetBleedBox, SetTrimBox, SetArtBox Attach the optional production page boxes defined by ISO 32000-1 §14.11.2. MediaBox still tracks the physical paper size; unset boxes fall back through the standard PDF default chain
SetPageRotation Set the page /Rotate entry. Values are normalised to the PDF-required multiples of 90 degrees in the range 0..359
SetUserUnit Set PDF 1.6 /UserUnit for very large pages. Passing 0 removes the entry and returns the page to the default unit scale
SetTabsOrder Set page annotation tab order through the AddHighlightAnnotation, AddUnderlineAnnotation, AddSquigglyAnnotation, AddStrikeOutAnnotation, AddPolylineAnnotation, AddPolygonAnnotation,
DocScale Adjust the page drawing scale used by compatibility drawing paths. Leave it at the default unless the caller intentionally needs scaled legacy coordinates

Transparency and Optional Content

Method Description
SetTransparencyGroup, SetTransparencyGroupICC, ClearTransparencyGroup Attach or remove a page /Group dictionary so alpha-bearing content composites as a PDF transparency group. The ICC variant references an ICC profile registered on the document
BeginOptionalContent, EndOptionalContent Wrap subsequent page drawing in a PDF 1.5 optional-content marked-content sequence. Register the layer first with THotPDF.RegisterOptionalContentGroup

Tagged Content and Type 3 Fonts

Method Description
BeginMarkedContentMCIDProps Begin a marked-content sequence with an inline property dictionary that includes AddInkAnnotation, AddCaretAnnotation, AddScreenAnnotation, AddWatermarkAnnotation, AddRedactAnnotation, Add3DAnnotation,
SetType3Font Select a Type 3 font registered through AddRichMediaAnnotation, AddPopupAnnotation - create review, multimedia, watermark, redaction, 3D, rich-media, and popup annotations

Text Positioning and Compatibility Helpers

Method Description
SetCharacterSpacing, SetTextMatrix, MoveToNextLine Emit low-level PDF text-state and positioning operators for callers that need direct control beyond TextOut, UnicodeTextOut, or the text-box helpers
SetRGBHyperlinkColor Set the RGB colour used by PrintHyperlink. The published HyperlinkColor property calls this setter
FMEllipse, MFRectangle Legacy drawing aliases kept for backward compatibility with older caller code. For new code, prefer Ellipse and Rectangle
DirectDrawBarcode Draw a barcode using direct page coordinates and a numeric barcode type. For typed code, prefer DrawBarcode with the THPDFBarcodeType enumeration
HPDFDefaultLineExtras and HPDFDefaultPolyExtras return zero-initialised extras records so callers can set only the optional line or polygon annotation fields they need The returned records are THPDFLineExtras and THPDFPolyExtrasShowMetafileEx Compatibility aliases or C++Builder-specific entry points that remain available for existing code. New code can usually use TextOut, RtLTextOut, SetFont, and ShowMetafile
Debug_GetProcessedRtlString, ProcessFont Diagnostic and low-level helpers exposed from the class. They are documented here for API visibility; normal document generation should use the higher-level text and font methods

Button Action Extensions

AddPushButtonWithHideAction, AddPushButtonWithSubmitAction, AddPushButtonWithRenditionAction, AddPushButtonWithSoundAction,

AddPAdESSignatureField or another signature-field helper first, then call AttachPAdESSeedValue with the field name and THPDFPAdESSeedValue settings; AddCertificationSignatureField creates the first signed field as the document certification signature, ConfigureCertificationSignature promotes an existing first signed placeholder, and AttachSignatureFieldLock applies All, Include, or Exclude field scope, while Certification Signatures and Field Locks explains the permission meanings, validation rules, and loaded inspection

See Also