/
Beispiel - MAILCAPTURE PDF Aufteilung in separate Dokumente

Beispiel - MAILCAPTURE PDF Aufteilung in separate Dokumente

Erläuterung

In diesem Beispiel wird ein aus MAILCAPTURE an den WARP übergebenes Dokument auf das Vorhandensein von mehreren PDF Anhängen geprüft. Ist dies der Fall wird das Dokument aufgeteilt in Einzeldokumente und am Ende gelöscht.

Skript

// ==================================================================================
// 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

Related content

Beispiel - MAILCAPTURE PDF Aufteilung in separate Dokumente
Beispiel - MAILCAPTURE PDF Aufteilung in separate Dokumente
More like this
Beispiel - MAILCAPTURE PDF Aufteilung in separate Dokumente
Beispiel - MAILCAPTURE PDF Aufteilung in separate Dokumente
More like this
MAILCAPTURE Postfachkonfiguration
MAILCAPTURE Postfachkonfiguration
More like this
MAILCAPTURE Postfachkonfiguration
MAILCAPTURE Postfachkonfiguration
More like this
Beispiel - FILECAPTURE
Beispiel - FILECAPTURE
More like this
Beispiel - FILECAPTURE
Beispiel - FILECAPTURE
More like this