THPDFRandomAccessSource Class

Abstract base class that lets THotPDF.LoadFromRandomAccessSource load a PDF from any caller-defined seekable byte store without requiring a TStream implementation

Declaration

THPDFRandomAccessSource = class
public
  function GetSize: Int64; virtual; abstract;
  function IsRangeAvailable(Offset, Count: Int64): Boolean; virtual;
  function ReadAt(Offset: Int64; var Buffer;
    Count: Longint): Longint; virtual; abstract;
  function ReadAtCancellable(Offset: Int64; var Buffer;
    Count: Longint; CancellationToken: THPDFCancellationToken): Longint; virtual;
  function TransferAt(Offset, Count: Int64;
    Destination: TStream): Int64; virtual;
end;

Unit

HPDFDoc

Members

NamePurpose
GetSizeReturns the stable byte length of the backing store
ReadAtReads Count bytes starting at Offset into Buffer
IsRangeAvailableReports whether a range can be read without waiting for additional data
ReadAtCancellableProvides a cooperative cancellation path for remote or otherwise blocking reads
TransferAtWrites a source range to a destination stream with a bounded fallback implementation

Usage notes

Related APIs