THPDFRTFImportOptions Record
Page geometry, input limits, OLE and cancellation controls for RTF import
Declaration
THPDFRTFImportOptions= record
PageWidth: Single;
PageHeight: Single;
MarginLeft: Single;
MarginTop: Single;
MarginRight: Single;
MarginBottom: Single;
MaxInputBytes: Int64;
MaxCharacters: Integer;
MaxPages: Integer;
MaxMetafileBytes: Int64;
UseCurrentPage: boolean;
AllowOLE: boolean;
CancellationToken: THPDFCancellationToken;
class function Default: THPDFRTFImportOptions; static;
end;
Unit
HPDFDoc
Fields
| Field | Purpose |
|---|---|
PageWidth | Target page width in points; the default is 595 |
PageHeight | Target page height in points; the default is 842 |
MarginLeft | Left margin in points; the default is 54 |
MarginTop | Top margin in points; the default is 54 |
MarginRight | Right margin in points; the default is 54 |
MarginBottom | Bottom margin in points; the default is 54 |
MaxInputBytes | Input size cap; the default is 16 MiB |
MaxCharacters | Character count cap; the default is 4000000 |
MaxPages | Rendered page cap; the default is 1000 |
MaxMetafileBytes | Per-page metafile size cap; the default is 256 MiB |
UseCurrentPage | When true the first rendered page goes onto the document's current page instead of adding a fresh one; default true |
AllowOLE | When false, input that contains OLE content is rejected with risInvalidInput; default false |
CancellationToken | Optional token that stops a long import with risCancelled; nil by default |
Usage notes
- Start from
THPDFRTFImportOptions.Defaultand override only the fields you need; the defaults give A4 portrait with 54-point margins - Import validates the geometry up front: page dimensions must be positive, margins must be non-negative, and opposite margins must leave room for content
- RTF import runs on the main thread only because it drives a RichEdit control; other threads get
risWrongThread