TStream to PDFium's FPDF_FILEACCESS callback structure
konstruktor Create(AStream: TStream; AOwnsStream: Boolean = False);
property Stream: TStream read FStream;
svojstvo OwnsStream: Boolean read FOwnsStream;
svojstvo FileAccess: FPDF_FILEACCESS read FFileAccess;
| Member | Description |
|---|---|
Create | Wrap a seekable TStream i opcionalno prenijeti tok ownership to the adapter |
Destroy | Releases adapter state and frees Stream when OwnsStream is True |
Stream | Underlying stream passed to the constructor |
OwnsStream | True when the adapter should free the stream in Destroy |
FileAccess | PDFium callback record suitable for FPDF_LoadCustomDocument |
TPdfStreamAdapter lets PDFium request byte ranges from a stream on demand instead of copying the whole PDF into memory before loading
The stream must support seeking and must remain alive for as long as the loaded FPDF_DOCUMENT can read from the adapter
TPdf.LoadCustomDocument uses the same adapter path for the high-level component API
Adapter := TPdfStreamAdapter.Create(FileStream, True);
Document := FPDF_LoadCustomDocument(@Adapter.FileAccess, nil);