Enterprise edition: link FPdfEnterprise with Lib\Enterprise on the search path; otherwise this method raises EPdfEnterpriseRequired; see the edition matrix
function PreparePadesRemoteSignature(Prepared: TStream; const Options: TPadesRemoteSignOptions; out Request: TPadesRemoteSigningRequest): Boolean;
Saves the active document, appends an invisible signature Widget and AcroForm field, reserves a fixed-width /Contents slot, finalises the incremental xref and trailer, and calculates the exact detached document digest with Options.DigestAlgorithm
Options.FieldOptions can author required seed values, allowed reasons and legal attestations, acceptable signer certificates, field locks and approval or certification transform parameters
The returned request binds the digest and ByteRange to the complete prepared PDF fingerprint so the workflow can resume after a process, machine or network boundary
| Prepared | Destination stream for the immutable placeholder PDF sent alongside the remote signing request |
| Options | Signature dictionary metadata, reserved CMS byte capacity, digest algorithm, and optional field constraints |
| Request | Persistent digest, digest choice, fingerprint, ByteRange, offset and capacity metadata |
Active to be TrueAcceptableCertificates because the remote signer certificate is not yet availableCertificationPermission accepts 1, 2 or 3, writes both DocMDP and catalog /Perms and rejects documents that already have a certification signatureLockAction writes both the field /Lock dictionary and matching FieldMDP signature transformContentsSize is clamped to at least 1024 bytes and limited to 64 MiBmessage-digest equals Request.DocumentDigestOptions.DigestAlgorithm selects that digest; SHA-256 stays format version 1 so an existing request file keeps its exact layout, and any SHA-3 member raises the request to version 2, which records the algorithm next to a variable-length digestPrepared without modification and serialise Request through SavePadesRemoteSigningRequest
var
Prepared, RequestData: TMemoryStream;
Options: TPadesRemoteSignOptions;
Request: TPadesRemoteSigningRequest;
begin
Options := TPadesRemoteSignOptions.Default;
Prepared := TMemoryStream.Create;
RequestData := TMemoryStream.Create;
try
if Pdf1.PreparePadesRemoteSignature(Prepared, Options, Request) then
TPdf.SavePadesRemoteSigningRequest(RequestData, Request);
finally
RequestData.Free;
Prepared.Free;
end;
end;