|
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 |
Create | Creates a manager for the requested TPDFVersType value |
Destroy | Releases the manager instance |
SetVersion | Changes the active PDF version and refreshes the derived feature set |
GetVersion | Returns the active TPDFVersType value |
GetVersionString | Returns the version string used for PDF output headers and diagnostics |
GetDocumentMode | Returns the document mode selected for the active version |
GetFeatures | Returns the complete feature set enabled by the active version |
SupportsObjectStreams | Reports whether the active version supports object streams |
SupportsCompression | Reports whether compressed output features are available |
SupportsTransparency | Reports whether transparency features are available |
SupportsAESEncryption | Reports whether AES encryption is available for the active version |
SupportsMetadataStreams | Reports whether metadata streams are available |
SupportsStructuredContent | Reports whether structured content features are available |
SupportsOptionalContent | Reports whether optional content groups are available |
ShouldUseEnhancedParsing | Reports whether enhanced parsing should be used for the active version |
ShouldUseStreamBasedObjects | Reports whether stream-based object handling should be preferred |
GetPreferredCompressionLevel | Returns the recommended TPDFCompressionLevel for the active version |
RequiresSpecialObjectHandling | Reports whether the active version requires object-stream-aware handling |
Version | Gets or sets the active PDF version |
DocumentMode | Returns 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 |
Create | Creates an indirect-object wrapper with an empty internal object reference |
Destroy | Releases the wrapper and its owned internal object when it has not already been freed |
MarkAsFreed | Marks the wrapped object as already freed so ownership cleanup is not repeated |
InternalObject | Gets or assigns the wrapped THPDFObject instance |
IsFreed | Reports 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, Destroy | Create and release a dictionary object owned by the supplied parent object |
GetIndexedKey, GetIndexedItem | Read a key or object by zero-based dictionary item index |
FindValue, FindValueCI | Find a key with legacy case-insensitive matching for tolerant parsing paths |
FindValueCS | Find a key with PDF-spec case-sensitive matching, which is required when names such as /ca and /CA must coexist |
AddValue, ReplaceValue, DeleteValue | Add, replace, or remove a dictionary entry while preserving object ownership semantics |
AddNameValue, AddStringValue, AddUnicodeStringValue, AddNumericValue, AddBooleanValue | Add 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, Destroy | Create and release an array object owned by the supplied parent object |
GetIndexedItem, SetIndexedItem | Read or replace the object at a zero-based array index |
AddObject | Append an existing PDF object, preserving indirect-reference handling where required |
AddNameValue, AddStringValue, AddNumericValue, AddBooleanValue | Append 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 |
THPDFObject | Base object carrying object number, indirect-object, deleted, dirty, and object-type state |
THPDFNullObject, THPDFBooleanObject, THPDFNumericObject, THPDFStringObject, THPDFNameObject | Scalar object wrappers used inside dictionaries, arrays, and parsed object graphs |
THPDFStreamObject | Stream object wrapper with a dictionary, byte stream, and Length property |
THPDFLazyFileStream | TStream descendant used for deferred loading of existing stream data; overrides Read, Seek, and Write for caller-visible stream semantics |
THPDFLink | Indirect-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 records | THPDFTSh, TIDMapping, THPDFPageOperation, THPDFParagraph, THPDFImageObject, THPDFDocLevelJSEntry, THPDFDocLevelDestEntry, THPDFPageLabelEntry, THPDFArticleThreadEntry, XRefItem, THPDFAcroFormUnicodeFontEntry, THPDFXFAPacket |
| Page operation progress | THPDFPageOperation identifies the OnPageOperationProgress callback operation as poAppend, poInsert, poExtract, or poMerge |
| Arrays and mapping records | TGenByteArray, TGenerationArray, TGSUBMatchedPositions, THPDFToUnicodeReverseEntry, THPDFToUnicodeReverseArray, TUnicodeSmpEntry, TUnicodeSmpArray, TUnicodeSmpCIDUsage, TUnicodeSmpCIDUsageArray |
| Version and feature state | TPDFDocumentMode, TPDFFeatureSet, THPDFPageLabelStyle |
| Annotation records and enums | THPDFAnnotationSubType, THPDFLineExtras, THPDFLineCaptionPlacement, THPDFLineIntent, THPDFPolyIntent, THPDFBorderEffectStyle, THPDFFormFieldType, THPDFFormFieldFlag, THPDFRenditionOperation |
| Line annotation extras | THPDFLineExtras 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 records | THPDFObjectType, THPDF_SIZES, IndexedChar, THPDFObjectNumber, THPDFDictionaryItem, THPDFCopyStructItem, THPDFDictArrItem |
| Metafile and drawing helpers | THPDFPen, THPDFRectangle, EMR_SMALLTEXTOUTA, PEMR_SMALLTEXTOUTA, TEMR_SMALLTEXTOUTA, PEMRSMALLTEXTOUTA, PCardn, THPDFDestinationType |
| Loaded-document name trees | THPDFNameTreeType selects the catalog name tree inspected by THotPDF.GetLoadedNameTreeRootCount |
| Measurement dictionaries | THPDFMeasureNumberFormatFraction selects decimal, fractional, or rounded number formatting in public measurement dictionary records |
| Signature appearance | THPDFSignatureDisplayOption and THPDFSignatureDisplayOptions select the border, signer name, reason, location, date, and label fields rendered by RenderSignatureFieldAppearance |
| Signature permissions | THPDFDocMDPPermission 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 discovery | THPDFSystemCertificateInfo carries subject, issuer, serial number, thumbprint, validity, key usage, store, and provider data; THPDFSystemCertificateArray is returned by certificate enumeration |
| Submit-form actions | THPDFSubmitFormFlag and THPDFSubmitFormFlags map the ISO 32000 SubmitForm action flags used by THPDFActionBuilder.SubmitForm |
| Factur-X attachments | THPDFFacturXAttachmentRole, THPDFFacturXAttachment, and THPDFFacturXAttachments describe primary invoice, UBL, EDIFACT, and supporting-document payloads returned from loaded hybrid invoices |
| JBIG2 backend callbacks | TJBIG2ByteArray, TJBIG2DecodeCallback, TJBIG2DecodeResult, TJBIG2EncodeCallback, and TJBIG2ScanlineArray define the optional decoder and encoder backend contracts |
| Annotation copying filters and options | THPDFAnnotCopyFilterEvent, THPDFAnnotCopyOption, and THPDFAnnotCopyOptions select visual, author, or IRT remapping behaviors when copying loaded annotations |
| Form validation options | THPDFFieldValidationOptions carries parameters for numeric, percent, date, range, or mask-based AcroForm field validations |
| File attachment icons | THPDFFileAttachmentIcon selects the markup icon type as faiPushPin, faiGraph, faiPaperclip, or faiTag |
| Document modification events | THPDFLoadedDocumentModifiedEvent notifies handlers about loaded page or annotation updates |
| Path geometry records | THPDFPathPoint carries X and Y coordinate double values for path drawing geometry structures |
| Watermark placeholder metadata | THPDFPlaceholderDocInfo carries the Author, Title, Subject, Keywords, and Producer values used by the metadata-aware HPDFReplaceWatermarkPlaceholders overload |
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 |
THPDFEmfOptions | Controls EMF and WMF scaling, image compression, reference DC, halftone, pen, frame, redraw, and canvas placement options; see FitPageRatio, ColorImageCompression, and CanvasOver |
THPDFContentBuilder | Builds scoped raw content operators through chainable state, colour, path, stroke, and fill methods; see AppendRawContent, SaveState, and Content |
THPDFFormXObjectBuilder | Extends THPDFContentBuilder for form XObject content and finalises the object through EndForm |
THPDFTilingPatternBuilder | Extends THPDFContentBuilder for tiling pattern content and finalises the pattern through EndPattern |
THPDFAcroFormField | Provides chainable form-field flags, tooltip, default appearance, and additional-action configuration; see SetDefaultAppearance and SetAdditionalAction |
THPDFActionBuilder | Creates 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 |
THPDFEmbeddedTargetKind | Selects parent, EmbeddedFiles name-tree child, attachment-index child, or attachment-name child target entries for GoToE |
THPDFLoadedActionKind | Identifies the 18 standard action subtypes returned by loaded action graph inspection |
THPDFOptionalBoolean | Preserves absent, false, and true states for optional action dictionary booleans such as NewWindow |
THPDFBackgroundRenderer | Queues 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 |
THPDFJBIG2Options | Controls lossless or lossy JBIG2 encoding, symbol dictionaries, global segments, backend selection, and cross-page accumulation; see Lossless, UseSymbolDictionary, and AccumulateGlobalsAcrossPages |
THPDFJBIG2Decoder | Decodes JBIG2 image and global data into scanlines; see LoadFromByteArray, GetScanline, and Width |
THPDFJBIG2Encoder | Encodes bi-level scanlines into JBIG2 image bytes with optional global segments; see EncodeToByteArray |
THPDFSearchPanel | VCL search panel for a connected loaded-document viewer; see ExecuteSearch, FindNext, and QueryText |
THPDFOutlineViewer | VCL 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
|