// ==================================================================================
// Name.............: Beispiel
// Info.............: MAILCAPTURE PDF Aufteilung in separate Dokumente
// ----------------------------------------------------------------------------------
// Company..........: CTO Balzuweit GmbH
// ----------------------------------------------------------------------------------
// Creation.........: 21.12.2021
// ==================================================================================
ccDocument.AllowProcessing := true;
EMLFileSource := '';
FileList := TStringList.Create;
try
for I := 0 to ccDocument.BlobCount - 1 do
begin
FileName := ccDocument.GetFileName(I);
Extension := Lowercase(ExtractFileExt(FileName));
if Extension = '.pdf' then
begin
FileList.Add(FileName);
end else if Extension = '.eml' then
begin
EMLFileSource := FileName;
end;
end;
if FileList.Count > 0 then
begin
Document := TccDocument.Create;
try
for I := 0 to FileList.Count - 1 do
begin
Document.Clear;
Document.Application := 'MailCapture Split Script';
Document.Id := CreateId;
Document.Project := '/InvoiceReader';
Document.Task := ccQT_Xtract;
Document.State := ccQS_Idle;
Document.AddBlob(FileList.Strings[I]);
Document.SaveToQueue(False, ccTM_Copy, 'MailCapture Script');
end;
finally
Document.Free;
end;
ccDocument.AllowProcessing := false;
ccDocument.DeleteFromQueue := true;
end;
finally
FileList.Free;
end;
// ==================================================================================
// EOF