THotPDF.ExtractLoadedEmbeddedFileToStream Method

function ExtractLoadedEmbeddedFileToStream(const AFileName: AnsiString;
  Destination: TStream; MaximumBytes: Int64;
  out AInfo: THPDFEmbeddedFileValidationInfo): Boolean;

Decodes the named embedded-file stream directly into Destination without materialising the complete payload in another buffer

A positive MaximumBytes stops extraction before the bound is exceeded, whilst zero uses no additional extraction bound

The result records actual and declared size, calculated and declared MD5, dates, MIME type, relationship, individual checks and a combined validity verdict

Pass nil as the destination to validate without retaining payload bytes