Code: Select all
procedure TMyPDFControl.SaveDoc(AFileName: String);
var
destPath: IAFS_Name;
begin
destPath := INST_AFS.DefaultFileSys.StringToName(PChar(AFileName), 0, nil);
FControl.Inst.ActiveDocView.Doc.Save(destPath, 0, nil, nil, nil, nil, nil, 0);
destPath := nil;
end;
Code: Select all
procedure TMyPDFControl.SaveDoc(AFileName: String);
var
destPath: IAFS_Name;
begin
destPath := nil;
if not SameText(AFileName, FControl.Inst.ActiveDocView.Doc.CoreDoc.SrcInfo.ActualFileName) then
destPath := INST_AFS.DefaultFileSys.StringToName(PChar(AFileName), 0, nil);
FControl.Inst.ActiveDocView.Doc.Save(destPath, 0, nil, nil, nil, nil, nil, 0);
destPath := nil;
end;