HPDFDoc Public Helper Classes and Support Types

This page covers public helper classes and support types exposed by the HPDFDoc, HPDFObjs, and HPDFTypes units for advanced version checks, object wrappers, dictionary editing, array editing, streams, and low-level PDF records

Use the main THotPDF and THPDFPage pages for normal document creation, loading, page drawing, and output workflows

TPDFVersionManager

TPDFVersionManager stores the selected PDF version, exposes the derived document mode, and reports which PDF features can be used for that version

Member Usage
CreateCreates a manager for the requested TPDFVersType value
DestroyReleases the manager instance
SetVersionChanges the active PDF version and refreshes the derived feature set
GetVersionReturns the active TPDFVersType value
GetVersionStringReturns the version string used for PDF output headers and diagnostics
GetDocumentModeReturns the document mode selected for the active version
GetFeaturesReturns the complete feature set enabled by the active version
SupportsObjectStreamsReports whether the active version supports object streams
SupportsCompressionReports whether compressed output features are available
SupportsTransparencyReports whether transparency features are available
SupportsAESEncryptionReports whether AES encryption is available for the active version
SupportsMetadataStreamsReports whether metadata streams are available
SupportsStructuredContentReports whether structured content features are available
SupportsOptionalContentReports whether optional content groups are available
ShouldUseEnhancedParsingReports whether enhanced parsing should be used for the active version
ShouldUseStreamBasedObjectsReports whether stream-based object handling should be preferred
GetPreferredCompressionLevelReturns the recommended TPDFCompressionLevel for the active version
RequiresSpecialObjectHandlingReports whether the active version requires object-stream-aware handling
VersionGets or sets the active PDF version
DocumentModeReturns the derived document mode for the active PDF version

THPDFIndirectObject

THPDFIndirectObject wraps an internal PDF object and tracks whether that wrapped object has already been freed during loaded-document processing

Member Usage
CreateCreates an indirect-object wrapper with an empty internal object reference
DestroyReleases the wrapper and its owned internal object when it has not already been freed
MarkAsFreedMarks the wrapped object as already freed so ownership cleanup is not repeated
InternalObjectGets or assigns the wrapped THPDFObject instance
IsFreedReports whether the wrapped object has already been marked as freed

THPDFDictionaryObject

THPDFDictionaryObject represents a PDF dictionary object and exposes typed helpers for key lookup, value insertion, replacement, and deletion

Member Usage
Create, DestroyCreate and release a dictionary object owned by the supplied parent object
GetIndexedKey, GetIndexedItemRead a key or object by zero-based dictionary item index
FindValue, FindValueCIFind a key with legacy case-insensitive matching for tolerant parsing paths
FindValueCSFind a key with PDF-spec case-sensitive matching, which is required when names such as /ca and /CA must coexist
AddValue, ReplaceValue, DeleteValueAdd, replace, or remove a dictionary entry while preserving object ownership semantics
AddNameValue, AddStringValue, AddUnicodeStringValue, AddNumericValue, AddBooleanValueAdd typed scalar values without manually constructing the matching PDF object wrapper

THPDFArrayObject

THPDFArrayObject represents a PDF array and exposes indexed access plus typed append helpers for common scalar values and object references

Member Usage
Create, DestroyCreate and release an array object owned by the supplied parent object
GetIndexedItem, SetIndexedItemRead or replace the object at a zero-based array index
AddObjectAppend an existing PDF object, preserving indirect-reference handling where required
AddNameValue, AddStringValue, AddNumericValue, AddBooleanValueAppend typed scalar values without manually constructing object wrappers

Basic Object Wrappers

The HPDFObjs unit exposes small PDF object wrapper classes for callers that build low-level dictionaries, arrays, and streams directly

Type Usage
THPDFObjectBase object carrying object number, indirect-object, deleted, dirty, and object-type state
THPDFNullObject, THPDFBooleanObject, THPDFNumericObject, THPDFStringObject, THPDFNameObjectScalar object wrappers used inside dictionaries, arrays, and parsed object graphs
THPDFStreamObjectStream object wrapper with a dictionary, byte stream, and Length property
THPDFLazyFileStreamTStream descendant used for deferred loading of existing stream data; overrides Read, Seek, and Write for caller-visible stream semantics
THPDFLinkIndirect-reference wrapper carrying the target object number

Public Support Types

The following support types are part of the public unit interfaces and can appear in method signatures, record fields, callback payloads, or low-level object helpers

Group Types
Page and document recordsTHPDFTSh, TIDMapping, THPDFPageOperation, THPDFParagraph, THPDFImageObject, THPDFDocLevelJSEntry, THPDFDocLevelDestEntry, THPDFPageLabelEntry, THPDFArticleThreadEntry, XRefItem, THPDFAcroFormUnicodeFontEntry, THPDFXFAPacket
Page operation progressTHPDFPageOperation identifies the OnPageOperationProgress callback operation as poAppend, poInsert, poExtract, or poMerge
Arrays and mapping recordsTGenByteArray, TGenerationArray, TGSUBMatchedPositions, THPDFToUnicodeReverseEntry, THPDFToUnicodeReverseArray, TUnicodeSmpEntry, TUnicodeSmpArray, TUnicodeSmpCIDUsage, TUnicodeSmpCIDUsageArray
Version and feature stateTPDFDocumentMode, TPDFFeatureSet, THPDFPageLabelStyle
Annotation records and enumsTHPDFAnnotationSubType, THPDFLineExtras, THPDFLineCaptionPlacement, THPDFLineIntent, THPDFPolyIntent, THPDFBorderEffectStyle, THPDFFormFieldType, THPDFFormFieldFlag, THPDFRenditionOperation
Line annotation extrasTHPDFLineExtras carries optional interior color, leader-line, caption, caption placement, caption offset, and line-intent values for extended line annotation overloads; use HPDFDefaultLineExtras to create a zero-initialized baseline record
Low-level object recordsTHPDFObjectType, THPDF_SIZES, IndexedChar, THPDFObjectNumber, THPDFDictionaryItem, THPDFCopyStructItem, THPDFDictArrItem
Metafile and drawing helpersTHPDFPen, THPDFRectangle, EMR_SMALLTEXTOUTA, PEMR_SMALLTEXTOUTA, TEMR_SMALLTEXTOUTA, PEMRSMALLTEXTOUTA, PCardn, THPDFDestinationType
Loaded-document name treesTHPDFNameTreeType selects the catalog name tree inspected by THotPDF.GetLoadedNameTreeRootCount
Measurement dictionariesTHPDFMeasureNumberFormatFraction selects decimal, fractional, or rounded number formatting in public measurement dictionary records
Signature appearanceTHPDFSignatureDisplayOption and THPDFSignatureDisplayOptions select the border, signer name, reason, location, date, and label fields rendered by RenderSignatureFieldAppearance
Signature permissionsTHPDFDocMDPPermission selects the certification permission level, THPDFFieldLockAction selects All, Include, or Exclude field scope, and THPDFSignaturePermissionInfo reports loaded DocMDP and FieldMDP structure. See Certification Signatures and Field Locks
System certificate discoveryTHPDFSystemCertificateInfo carries subject, issuer, serial number, thumbprint, validity, key usage, store, and provider data; THPDFSystemCertificateArray is returned by certificate enumeration
Submit-form actionsTHPDFSubmitFormFlag and THPDFSubmitFormFlags map the ISO 32000 SubmitForm action flags used by THPDFActionBuilder.SubmitForm
Factur-X attachmentsTHPDFFacturXAttachmentRole, THPDFFacturXAttachment, and THPDFFacturXAttachments describe primary invoice, UBL, EDIFACT, and supporting-document payloads returned from loaded hybrid invoices
JBIG2 backend callbacksTJBIG2ByteArray, TJBIG2DecodeCallback, TJBIG2DecodeResult, TJBIG2EncodeCallback, and TJBIG2ScanlineArray define the optional decoder and encoder backend contracts
Annotation copying filters and optionsTHPDFAnnotCopyFilterEvent, THPDFAnnotCopyOption, and THPDFAnnotCopyOptions vizuális, szerzői vagy IRT-leképezési viselkedés kiválasztása betöltött annotációk másolásakor
Form validation optionsTHPDFFieldValidationOptions paramétereket hordoz a numerikus, százalékos, dátum-, tartomány- vagy maszkalapú AcroForm mezőellenőrzésekhez
File attachment iconsTHPDFFileAttachmentIcon selects the markup icon type as faiPushPin, faiGraph, faiPaperclip, or faiTag
Document modification eventsTHPDFLoadedDocumentModifiedEvent értesíti a kezelőket a betöltött oldal vagy annotáció frissítéseiről
Path geometry recordsTHPDFPathPoint carries X and Y coordinate double values for path drawing geometry structures

Public Builder and Option Classes

These helper classes are returned by, assigned to, or configured through the main THotPDF and THPDFPage APIs

Class Purpose and member reference
THPDFEmfOptionsControls EMF and WMF scaling, image compression, reference DC, halftone, pen, frame, redraw, and canvas placement options; see FitPageRatio, ColorImageCompression, and CanvasOver
THPDFContentBuilderBuilds scoped raw content operators through chainable state, colour, path, stroke, and fill methods; see AppendRawContent, SaveState, and Content
THPDFFormXObjectBuilderExtends THPDFContentBuilder for form XObject content and finalises the object through EndForm
THPDFTilingPatternBuilderExtends THPDFContentBuilder for tiling pattern content and finalises the pattern through EndPattern
THPDFAcroFormFieldProvides chainable form-field flags, tooltip, default appearance, and additional-action configuration; see SetDefaultAppearance and SetAdditionalAction
THPDFActionBuilderCreates URI, JavaScript, local, remote, GoToE embedded navigation, launch, media, layer, submit, reset, hide, and chained PDF actions; see Action Graph Inspection and GoToE Navigation, URI, and ThenAction
THPDFEmbeddedTargetKindSelects parent, EmbeddedFiles name-tree child, attachment-index child, or attachment-name child target entries for GoToE
THPDFLoadedActionKindIdentifies the 18 standard action subtypes returned by loaded action graph inspection
THPDFOptionalBooleanPreserves absent, false, and true states for optional action dictionary booleans such as NewWindow
THPDFBackgroundRendererQueues loaded pages for background rendering and returns caller-owned bitmap copies; see RequestPage, CancelAll, and GetCachedBitmap; THPDFBackgroundRenderer.Execute is the thread entry point and must not be called directly
THPDFJBIG2OptionsControls lossless or lossy JBIG2 encoding, symbol dictionaries, global segments, backend selection, and cross-page accumulation; see Lossless, UseSymbolDictionary, and AccumulateGlobalsAcrossPages
THPDFJBIG2DecoderDecodes JBIG2 image and global data into scanlines; see LoadFromByteArray, GetScanline, and Width
THPDFJBIG2EncoderEncodes bi-level scanlines into JBIG2 image bytes with optional global segments; see EncodeToByteArray
THPDFSearchPanelVCL search panel for a connected loaded-document viewer; see ExecuteSearch, FindNext, and QueryText
THPDFOutlineViewerVCL outline tree connected to a loaded document and viewer; see RefreshOutlines, PDFDocument, and Viewer

Global HPDFDoc and HPDFJBIG2 APIs

Declaration Usage
procedure HPDFEnablePerMonitorDPI;Opt-in helper that requests per-monitor DPI awareness on supported Windows versions and otherwise returns without error
function HPDFFormatPDFDate(D: TDateTime; IncludeTimezone: boolean = True): AnsiString;Formats a Delphi date-time as a PDF date string and optionally appends the UTC timezone suffix
HPDF_NO_MASK: TColor = TColor(-1);Sentinel passed to SearchAndRedactReplaceLoaded when replacement text should not receive a mask rectangle
function HPDFDictStringValue(Dict: THPDFDictionaryObject; const Key: AnsiString): AnsiString;Returns a string value from a low-level PDF dictionary or an empty string when the key is absent or has another value type
procedure HPDFGetInstalledPrinters(List: TStrings);Clears and fills a caller-owned list with installed printer names in printer-index order
function HPDFGetPrinterCapabilities(const PrinterName: string; out Caps: THPDFPrinterCapabilities): boolean;Reads duplex, colour, copy-count, paper-bin, paper-size, and resolution capabilities for a named or default printer
procedure HPDFNormalizeRect(...);Normalises TRect, THPDFRectangle, or four extended coordinates so left does not exceed right and top does not exceed bottom
procedure RegisterJBIG2DecoderBackend(Backend: TJBIG2DecodeCallback);Registers the preferred in-process JBIG2 decoder callback
procedure RegisterJBIG2ExternalDecoderBackend(Backend: TJBIG2DecodeCallback);Registers an optional external JBIG2 decoder callback used by explicit external-decoder workflows
procedure RegisterJBIG2EncoderBackend(Backend: TJBIG2EncodeCallback);Registers the preferred JBIG2 encoder callback used when UseExternalEncoder is enabled
procedure ClearJBIG2DecodeResult(var DecodeResult: TJBIG2DecodeResult);Releases and resets scanline buffers returned by a JBIG2 decoder backend
procedure ClearJBIG2Backends;Clears all registered JBIG2 decoder and encoder callbacks
function DefaultJBIG2EncodeOptions: TJBIG2EncodeOptions;Returns the default lossless JBIG2 encoder option record
function IsJBIG2DecoderBackendAvailable: Boolean;, function IsJBIG2ExternalDecoderBackendAvailable: Boolean;, function IsJBIG2EncoderBackendAvailable: Boolean;Report whether each optional JBIG2 backend is currently registered
procedure SetPreferExternalJBIG2Decoder(Value: Boolean);, function GetPreferExternalJBIG2Decoder: Boolean;Set or read the process-wide preference for the external decoder when both decoder backends are available

See also