<SourceFile> tag content doesn't match the source file name


In Document Definition > Export Settings the <SourceFile> tag is used for export file naming. However, if the image was imported from the Web Capture Station, the name of the exported file does not match with the source one.


The Web Capture Station does not save the source file name in the export file naming <SourceFile> tag.


To use the original filename as a part of the output file name, modify the document definition as described below:
  1. Open the document definition and create a new service field;
  2. Navigate to the field's properties > Data Source tab and select Image Source from the Source drop-down list.

    Note: if necessary, you can hide this field from the document form, so verification operators won't see it, and prevent it from being exported by disabling "Export field value" and "Show on verification" options on the field's properties →  General tab.​

  3.  Create a new text field;​
  4.  Navigate to the field's properties > General tab and set only the Index field option as active.

    Note: you can also turn on the "Show on verification" option just to check whether the source file name will be displayed correctly.

  5.  Go to the Rules tab and create a new script rule:
    • Add both the service field and the text one;
    • Remove the "Read Only" mark from the text field;
    • Enter the following code in the script editor window (it's C# code):
      using System.IO;

      string path = Context.Field("Service Field").Text;
      Context.Field("Name").Text = Path.GetFileName(path);
    • Save changes.
  6. Go to the export settings of the document definition, select required export destination;
  7. Under Template settings click the "Edit..." button and select Advanced view;​
  8. Scroll down tags list, from Index fields select the one that has been created on step 3 (text field with a rule on it);
  9.  Apply new settings, save changes and publish a new version of the document definition.

Was this article helpful?

2 out of 2 found this helpful

Have more questions? Submit a request



Please sign in to leave a comment.

Recently viewed