IHPDFCustomStreamFilter
Defines a reference-counted custom decoder used by loaded stream filter pipelines
Declaration
IHPDFCustomStreamFilter = interface(IInterface)
function GetFilterName: AnsiString;
function GetMode: THPDFCustomStreamFilterMode;
function GetInputSeekContract: THPDFCustomStreamSeekContract;
function GetOutputSeekContract: THPDFCustomStreamSeekContract;
function DecodePush(Input, Output: TStream;
const Request: THPDFCustomStreamFilterRequest;
out Diagnostic: AnsiString): Boolean;
function OpenPullStream(Input: TStream;
const Request: THPDFCustomStreamFilterRequest;
out DecodedStream: TStream;
out Diagnostic: AnsiString): Boolean;
end;
Parameters
Input is borrowed for the callback, Output is an isolated bounded destination for push mode, and Request supplies stage identity, remaining budget, and cancellation
DecodedStream is owned by HotPDF after a successful pull result, while Diagnostic should explain a false result
Return value
Return True only after producing a complete valid stage result
Usage notes
- Only the method selected by
Modeis called - Do not free, retain, or return the borrowed
Inputstream - Long operations should check
Request.CancellationTokencooperatively - Exceptions are isolated as
dpsCustomFilterError,dpsBudgetExceeded, ordpsCancelled - Callbacks execute synchronously and outside the registry lock