function SaveSourceBytes(Stream: TStream): Boolean; overload;
function SaveSourceBytes(const FileName: string): Boolean; overload;
Copies the retained source of the active document verbatim: the stream, buffer or file it was loaded from, or the bytes a library transaction reloaded it from
This is the save path for a signed document filled through SetFormFieldValues: the write appends one revision after the original signed bytes and reloads the instance from that result, so the copy keeps every earlier ByteRange segment byte-identical and the signatures stay valid
SaveAs and the repair writers serialise the document through PDFium instead; on a signed source they rewrite objects the signatures cover, so a reloaded result no longer validates. Since v3.382.3 an incremental save session started on a signed source appends after the same source bytes, so it is the way to add native edits after a signed fill
| Stream | Destination stream; it is truncated and then receives the complete source bytes |
| FileName | Destination file; the bytes are written to a temporary file alongside it, which then replaces the target |
True when the complete source was written; False when no complete source is retained, for example whilst a progressive document is still loadingActive to be TrueSaveAs for those, or the library methods that publish a revision and reloadEPdfError, because its pending changes exist only in the native documentCompressed property has no effect on this outputSetFormFieldValues keep the appended revision sealed with the document keys
var
Requests: TPdfFormValueRequests;
Report: TPdfFormValuesWriteReport;
begin
Pdf1.FileName := 'signed-form.pdf';
Pdf1.Active := True;
SetLength(Requests, 1);
Requests[0] := Default(TPdfFormValueRequest);
Requests[0].Page := 1;
Requests[0].FieldIndex := 0;
Requests[0].Value.Kind := fvkText;
Requests[0].Value.Text := 'Approved';
if Pdf1.SetFormFieldValues(Requests, Report) then
Pdf1.SaveSourceBytes('signed-form-filled.pdf')
else
ShowMessage(Report.ErrorMessage);
end;