THotPDF.LoadFromRandomAccessSource
Loads a PDF through a caller-defined seekable byte source without requiring a TStream implementation
Declarations
THPDFRandomAccessSource = class
public
function GetSize: Int64; virtual; abstract;
function ReadAt(Offset: Int64; var Buffer;
Count: Longint): Longint; virtual; abstract;
end;
function LoadFromRandomAccessSource(
Source: THPDFRandomAccessSource;
OwnsSource: Boolean = False): Integer; overload;
function LoadFromRandomAccessSource(
Source: THPDFRandomAccessSource;
const Password: AnsiString;
OwnsSource: Boolean = False): Integer; overload;
Contract
GetSizereturns the stable byte length and must not return a negative valueReadAtreads at the supplied zero-based offset and returns a count from zero through the requested count- The source must remain valid while the loaded document is in use unless
OwnsSourceisTrue - With ownership enabled, HotPDF frees the source when another source is loaded, when loading fails, or when the component is destroyed
- The password overload may stage encrypted source bytes for security-handler compatibility
The result is the loaded page count, matching LoadFromFile and LoadFromStream
See also: Scalable Loading, LoadFromStream