THotPDF.EmptyPasswordOpens Method
Probes whether the empty user password can decrypt a PDF stream without committing a load
Declaration
function EmptyPasswordOpens(Stream: TStream): boolean;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
Stream | 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 - Cancellation exceptions propagate; every other failure reports
False LoadFromFilewithAutoDecryptenabled uses this probe on a read-only share stream to decide whether to take the empty-password load path instead of prompting