THPDFRTFImportOptions Record
Page geometry, input limits, OLE handling 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; 595 by default |
PageHeight | Target page height in points; 842 by default |
MarginLeft | Left margin in points; 54 by default |
MarginTop | Top margin in points; 54 by default |
MarginRight | Right margin in points; 54 by default |
MarginBottom | Bottom margin in points; 54 by default |
MaxInputBytes | Cap on the input size; 16 MiB by default |
MaxCharacters | Cap on the character count; 4000000 by default |
MaxPages | Cap on rendered pages; 1000 by default |
MaxMetafileBytes | Cap on per-page metafile size; 256 MiB by default |
UseCurrentPage | When true the first rendered page goes onto the document's current page rather than adding a fresh one; true by default |
AllowOLE | When false, input that contains OLE content is turned away with risInvalidInput; false by default |
CancellationToken | Optional token that brings a long import to a stop with risCancelled; nil by default |
Usage notes
- Start from
THPDFRTFImportOptions.Defaultand override only the fields you need; the defaults give A4 portrait with margins of 54 points - Import checks 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 are given
risWrongThread