THotPDF.EmptyPasswordOpens Method
Probes whether the empty user password can decrypt a PDF stream, without committing to a load
Declaration
function EmptyPasswordOpens(Stream: TStream): boolean;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
Stream | The positioned PDF stream to probe |
Return value
True when key recovery succeeds with the empty user password, otherwise False
Usage notes
- Runs the same key-recovery machinery as
RecoverReloadKeysFromStreamRangeswith an empty password, then restores the stream position and clears the temporarily recovered key state, so the probe leaves no side effects behind - Cancellation exceptions propagate; every other failure reports
False LoadFromFilewithAutoDecryptenabled applies this probe on a read-only share stream to decide whether to take the empty-password load path rather than prompting