How to Implement the Script

Top  Previous  Next

To implement a PageGate filter script, this is what you'll need to do:

 

1)Copy pgfilter.exe and pgfilter.xml to a directory of your choosing. For example, c:\PageGateData\ASCII\Filter\

1a) If you want to engage the filter script before the GetASCII module can process data, copy preproc.bat in to the same folder.

1b) If you're processing files placed in the folder by use of a File carrier in PageGate, copy pstproc.bat in to the same folder.

2)Configure PageGate's GetASCII module to reference the directory to which you have copied the files.

3)Edit the contents of pgfilter.xml to configure the filter script.

 

When using preproc.bat and the GetASCII module, the chain of events that triggers the filter script to run is as follows:

 

1)The GetASCII Interface finds a new file to process.

2)If there is a preproc.bat file (or preprocv.bat) contained within the directory, GetASCII will run it, passing the name of the file it has just found on the command line.

3)preproc.bat should be set to run pgfilter.exe, again passing it the name of the text file from GetASCII.

4)pgfilter.exe will look to the command line parameters passed to it to get the name of the input text file and the (optional) name of the XML file to use.

5)pgfilter will read the XML settings file from the command line or use pgfilter.xml if one isn't passed. It is highly recommended to use the XML file rather than the command line.

6)pgfilter will perform all functions coded in the pgfilter.xml file, then terminate.

7)The data output by the pgfilter will be processed for delivery by the GetASCII module.

 

When using pstproc.bat and files placed in the folder, the chain of events that triggers the filter script to run is as follows:

 

1)A file is placed in the filter script's folder by a File carrier in PageGate.

2)If there is a pstproc.bat file (or pstprocv.bat) contained within the directory, PageGate will run it, passing the name of the file it has just generated on the command line.

3)pstproc.bat should be set to run pgfilter.exe, again passing it the name of the text file from the File carrier.

4)pgfilter.exe will look to the command line parameters passed to it to get the name of the input text file and the (optional) name of the XML file to use.

5)pgfilter will read the XML settings file from the command line or use pgfilter.xml if one isn't passed. It is highly recommended to use the XML file rather than the command line.

6)pgfilter will perform all functions coded in the pgfilter.xml file, then terminate.

 

After implementing a filter script, it is highly recommend that you go through a debugging process to verify what you've configured. See Debugging the Script for more information.