Error "All fill bits preceding EOL code must be 0."
Problem
If you are using YajHFC 0.5.2 or higher with the PDF plugin you may get the following (or a similar) exception when trying to view a received fax:
An error occured displaying the fax "faxNNNNNNNNN.tif":
All fill bits preceding EOL code must be 0.
java.lang.RuntimeException: All fill bits preceding EOL code must be 0.
at com.itextpdf.text.pdf.codec.TIFFFaxDecoder.readEOL(TIFFFaxDecoder.java:1307)
at com.itextpdf.text.pdf.codec.TIFFFaxDecoder.decode2D(TIFFFaxDecoder.java:797)
at com.itextpdf.text.pdf.codec.TiffImage.getTiffImage(TiffImage.java:237)
at com.itextpdf.text.pdf.codec.TiffImage.getTiffImage(TiffImage.java:106)
at yajhfc.file.pdf.ITextTIFFFileConverter.convertToHylaFormat(ITextTIFFFileConverter.java:65)
at yajhfc.file.MultiFileConverter.convertMultipleFiles(MultiFileConverter.java:102)
at yajhfc.file.MultiFileConverter.convertMultipleFilesToSingleFile(MultiFileConverter.java:187)
at yajhfc.file.MultiFileConverter.viewMultipleFiles(MultiFileConverter.java:162)
at yajhfc.MainWin$ShowWorker.doWork(MainWin.java:491)
at yajhfc.util.ProgressWorker.run(ProgressWorker.java:189)
Solution
This seems to be an incompatibility between iText and the TIFF files in your HylaFAX installation. Especially capi4hylafax is known to often produce such files.
So far, no fix from iText is available.
The TIFF files usually work fine with tiff2pdf or common Windows or Linux TIFF viewers.
The best solution for this problem is to install YajHFC 0.5.5 or higher and use the native libtiff plugin.
If you cannot do that, please use the following workaround if you experience this problem:
- Make sure tiff2pdf is installed
- If you are using Windows Vista, 7 or newer:
Please downloadtiff2pdf.cmdand place it in the same directory astiff2pdf.exe. This works around a bugtiff2pdf.exehas on newer Windows versions. - In YajHFC, open the Options dialog.
- If you use Windows, make sure that under Paths & Viewers the correct path to
tiff2pdfis set. (if you have installedtiff2pdf.cmd, this should be the full path totiff2pdf.cmd, else the path totiff2pdf.exe)
In Linux, just using the defaulttiff2pdf(without path) will usually work fine. - Under Paths & Viewers→PDF support (iText), uncheck the option Use iText to convert TIFF→PDF.
- Close the Options dialog with OK
- Now YajHFC should use
tiff2pdfto convert the received faxes to PDF. If you still have problems, please write to the yajhfc-user mailing list