THotPDF.IsLoadedSourceStreamAlias Method

function IsLoadedSourceStreamAlias(Stream: TStream): Boolean;

Returns True when Stream is a retained source, random-access input, incremental input, or graph-reload stream, or when its Windows file identity matches a retained source file

File identity uses the volume serial number and file index, allowing separate handles and hard links to be recognized; a source loaded by filename is checked through its recorded source path

The method is read-only and does not seek or change stream positions; nil returns False

Keep caller-owned source streams alive for the loaded document's lifetime

Opaque custom stream wrappers and arbitrary random-access providers may hide their underlying identity, so the caller must ensure that such an output cannot overwrite source storage

Call this method before any truncating or modifying file operation; constructing a TFileStream with fmCreate has already truncated its file before alias checking can protect it

For conversion to a filename, use HPDFConvertLoadedToPDFA4RasterFile, which checks existing target identity before creating temporary output and publishing it