I’m working on the job to create PDF by Datamapper +Template. there is no separation in PDF, template PDF name is defined by fields of record, all template PDF has 2 pages. Is it possible to know the creation status for each record at the end of output creation or at the end of each template/record creation? for example, if template PDF for the 5th record is not found, how can i get the index of record + the reason? and is it possible to save the status information into an external txt file? can i use “control script” to record the status?
You could definitly define a script in Workflow that would go through your data prior of it reaching the Template. From it you could log all you want and even modify your data (maybe remove the faulty record) so the job goes on clean.
As far as doing it from the Template, it can be done but is it out of my actual knowledge. I will let a more experimented user answer it.
Thanks for your help.could you kindly provide an example of going through data before template?
is it possible to get “output creation” success or fail result after the creation? Can I make a log during template creation and then parse the log in following workflow?
'********************************************************************
’ Standard VB Script template for PlanetPress Watch action.
'********************************************************************
'********************************************************************
’ Variable declaration
'********************************************************************
Option explicit
Dim objFSO
Dim objInputFile, objOutputFile
Dim sTempName, sTempPath, sLine
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
'********************************************************************
’ Main
'********************************************************************
’ Create the input text file object
Set objInputFile = objFSO.OpenTextFile(Watch.GetJobFilename, 1)
’ Get the temp path
sTempPath = objFSO.GetFile(Watch.GetJobFilename).ParentFolder.Path
’ Get the temp file name
sTempName = objFSO.GetTempName
’ Create an opened temp output file
Set objOutputFile = objFSO.GetFolder(sTempPath).CreateTextFile(sTempName)
’ Read the input file line by line
Do While not(objInputFile.AtEndOfStream)
sLine = objInputFile.ReadLine
'****** PUT YOUR CODE HERE **************
objOutputFile.WriteLine(sLine)
Loop
objInputFile.Close
objOutputFile.Close
’ Replace the input file by the output file
objFSO.DeleteFile Watch.GetJobFilename, true
objFSO.MoveFile sTempPath & "" & sTempName, Watch.GetJobFilename