KTA v7.7, v7.8
After upgrading to v7.7 or v7.8,
A job created based on a capture process that uses a custom dll (based on the Kofax.TotalAgility.Sdk.Samples shipped with KTA) to add Annotations or Redaction now suspends on PDF Generation with the following error:
Execution of activity PDF in job JOBID on Kofax Transformation Server - servername was aborted due to the following error(s): Error from ExtractionProcess.exe:
Generate Pdf failed: Invalid pointer was passed as argument
See Kofax Transformation Server log for details.
The problem is caused by the call in the custom .Net to burn the image,
The annotation/redaction itself is not the issue, it is the type of the resulting image.
In the document repository, the page image data are saved with the mime type “image/tiff” (and are declared as “image/tiff”),
In KTA, .tif is the defined image format on which the Transformation components work.
What happens now in the .NET activity is that the new image is saved with type “image/png” (but declared as “image/tiff”),
In 7.5 the Transformation components were more tolerant to read this "wrong" format whereas KTA v7.7/v7.8 will now try to read the .png data as tiff and it fails - throwing the error noted above
The following bug has been raised for this issue:
Bug 1501779: The Transformation components should have the same behavior as in 7.5 (probing all available image filters to load the image, even if it has the wrong type declaration)
Check the methods BurnDataImage/BurnDataString for the following line that returns a PNG byte array:
return (byte)new ImageConverter().ConvertTo(tmpBitmap, typeof(byte));
Replace the line above with the code below:
using (var tiffStream = new MemoryStream())