KB0019203 – Folder import error when file has a long name
Applies to: Ephesoft Transact 4.x and above
Issue
Folder import fails for a PDF with an error like the following one:
Converted Tiff files count not equal to the the TIFF pages count. actualTiffFilesCount :: 0, expectedTifFilesCount :: 15 for batch instance ::BI9
2017-10-12 10:56:39,418 [ERROR] [pool-1-thread-3] [com.ephesoft.dcma.imp.FolderImporter] – Converted Tiff files count not equal to the the TIFF pages count. actualTiffFilesCount :: 0, expectedTifFilesCount :: 15 for batch instance ::BI9
2017-10-12 10:56:39,422 [ERROR] [pool-1-thread-3] [com.ephesoft.dcma.imp.service.ImportServiceImpl] – Converted Tiff files count not equal to the the TIFF pages count.
com.ephesoft.dcma.core.exception.DCMAApplicationException: Converted Tiff files count not equal to the the TIFF pages count.
Root Cause
Windows has a limit on path length equal to 260 characters. When a file name is very long, the path during file import is even longer since various directories are created with the name of the original file. This happens when Ephesoft calls Ghostscript to convert the PDF file to multiple single page TIFFs.
Files with a name of around 50 characters are likely to experience this error, especially on versions previous to 4.1x
This error is extremely unlikely to happen on Linux as the maximum allowed path is 4094 characters.
Solution
Change the name of the file to something shorter.
Net permissible file path length = 227 characters .
File path + file name should be 227 characters max.
If the total length exceeds 227, then you will see issues.
Below is the formula.
int permissibleLength = PERMISSIBLE_LIMIT_PATH_LENGTH_WINDOWS - PDF_PROCESSING_FOLDER.length() - 10; PERMISSIBLE_LIMIT_PATH_LENGTH_WINDOWS = 259 PDF_PROCESSING_FOLDER.length() = 22
So net permissible file path length = 259 – 22 – 10 = 227
The calculation above is provided for Windows, Linux OS has different calculations.