Fax Pro (XactFax) module: "TIFF/F format is not compatible" issue when try to send a FAX with certain documents

Are there some sort of (pre)requisites that need to be provided regarding PDF before attaching a PDF file in order to send a FAX through User Portal?

I tried PDF generated by exporting a document typed with LibreOffice Writer and I have had no problems but if I try to send a FAX attaching a PDF generated by Sane (so a digitalized document) or a FAX in which just a single PDF file, among others, is created with Sane, then I face an issue with faxpro_helper.php that reports at some point:

“TIFF/F format is not compatible”

and the FAX will fail.

Best regards, Davide.

FYI, I just want to add that:

[font=Courier]Connected to Asterisk 11.4.0 currently running on freepbx (pid = 30277)
freepbxCLI> core show applications like fax
-= Matching Asterisk Applications =-
ReceiveFAX: Receive a FAX and save as a TIFF/F file.
SendFAX: Sends a specified TIFF/F file as a FAX.
-= 2 Applications Matching =-
freepbx
CLI> module show like fax
Module Description Use Count
res_fax.so Generic FAX Applications 1
res_fax_spandsp.so Spandsp G.711 and T.38 FAX Technologies 4
2 modules loaded
[/font]

and fax and faxpro modules are up to date (2.11.0.0 and 2.11.8) on my FreePBX Distro 4.211.64-6.

It just uses ghostwriter to convert the PDF to Postscript. That tells me that ghostwriter says its not a valid PDF.

Well Tony the fact is that converted uploaded PDF into TIFF (to send the FAX) works differently if I upload a PDF generated by LibreOffice Writer other than by SANE.

Both PDF files are recognized as PDF and both are then converted into TIFF but tiffinfo gave me different results when I check generated TIFF files.

I have logs about that and FAX Pro generated both PDF previews (for both uploaded PDF).

I suspect there is something about the chaining of PDF…or something about the way the conversion (PDF->TIFF) of some specific PDF happens.

As example this is the result of tiffinfo on fax-1378499996569.tif (which I have available under /var/spool/asterisk/tmp folder):

TIFF Directory at offset 0x845e (33886)
Subfile Type: multi-page document (2 = 0x2)
Image Width: 1728 Image Length: 2156
Resolution: 204, 196 pixels/inch
Bits/Sample: 1
Compression Scheme: CCITT Group 4
Photometric Interpretation: min-is-white
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 1
Rows/Strip: 2156
Planar Configuration: single image plane
Page Number: 0-0
Software: GPL Ghostscript 8.70
DateTime: 2013:09:06 22:39:57
Group 4 Options: (0 = 0x0)
TIFF Directory at offset 0x17ac6 (96966)
Subfile Type: multi-page document (2 = 0x2)
Image Width: 1728 Image Length: 2292
Resolution: 204, 196 pixels/inch
Bits/Sample: 1
Compression Scheme: CCITT Group 4
Photometric Interpretation: min-is-white
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 1
Rows/Strip: 2292
Planar Configuration: single image plane
Page Number: 1-0
Software: GPL Ghostscript 8.70
DateTime: 2013:09:06 22:39:54
Group 4 Options: (0 = 0x0)
TIFF Directory at offset 0x3d5ba (251322)
Subfile Type: multi-page document (2 = 0x2)
Image Width: 2210 Image Length: 1930
Resolution: 204, 196 pixels/inch
Bits/Sample: 1
Compression Scheme: CCITT Group 4
Photometric Interpretation: min-is-white
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 1
Rows/Strip: 1930
Planar Configuration: single image plane
Page Number: 2-0
Software: GPL Ghostscript 8.70
DateTime: 2013:09:06 22:39:55
Group 4 Options: (0 = 0x0)
TIFF Directory at offset 0x52a4c (338508)
Subfile Type: multi-page document (2 = 0x2)
Image Width: 1677 Image Length: 2281
Resolution: 204, 196 pixels/inch
Bits/Sample: 1
Compression Scheme: CCITT Group 4
Photometric Interpretation: min-is-white
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 1
Rows/Strip: 2281
Planar Configuration: single image plane
Page Number: 3-0
Software: GPL Ghostscript 8.70
DateTime: 2013:09:06 22:39:55
Group 4 Options: (0 = 0x0)
TIFF Directory at offset 0x62442 (402498)
Subfile Type: multi-page document (2 = 0x2)
Image Width: 1677 Image Length: 2281
Resolution: 204, 196 pixels/inch
Bits/Sample: 1
Compression Scheme: CCITT Group 4
Photometric Interpretation: min-is-white
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 1
Rows/Strip: 2281
Planar Configuration: single image plane
Page Number: 4-0
Software: GPL Ghostscript 8.70
DateTime: 2013:09:06 22:39:56
Group 4 Options: (0 = 0x0)

This FAX gave me the message about “TIFF/F format is not compatible” during the sending attempt.

A FAX that was sent without issue gave me this:

TIFF Directory at offset 0x5880 (22656) Subfile Type: multi-page document (2 = 0x2) Image Width: 1728 Image Length: 2156 Resolution: 204, 196 pixels/inch Bits/Sample: 1 Compression Scheme: CCITT Group 4 Photometric Interpretation: min-is-white FillOrder: msb-to-lsb Orientation: row 0 top, col 0 lhs Samples/Pixel: 1 Rows/Strip: 2156 Planar Configuration: single image plane Page Number: 0-0 Software: GPL Ghostscript 8.70 DateTime: 2013:09:06 19:08:49 Group 4 Options: (0 = 0x0) TIFF Directory at offset 0xc1ac (49580) Subfile Type: multi-page document (2 = 0x2) Image Width: 1728 Image Length: 2292 Resolution: 204, 196 pixels/inch Bits/Sample: 1 Compression Scheme: CCITT Group 4 Photometric Interpretation: min-is-white FillOrder: msb-to-lsb Orientation: row 0 top, col 0 lhs Samples/Pixel: 1 Rows/Strip: 2292 Planar Configuration: single image plane Page Number: 1-0 Software: GPL Ghostscript 8.70 DateTime: 2013:09:06 19:08:49 Group 4 Options: (0 = 0x0)

Another good one:

TIFF Directory at offset 0x3ace (15054) Subfile Type: multi-page document (2 = 0x2) Image Width: 1728 Image Length: 2292 Resolution: 204, 196 pixels/inch Bits/Sample: 1 Compression Scheme: CCITT Group 4 Photometric Interpretation: min-is-white FillOrder: msb-to-lsb Orientation: row 0 top, col 0 lhs Samples/Pixel: 1 Rows/Strip: 2292 Planar Configuration: single image plane Page Number: 0-0 Software: GPL Ghostscript 8.70 DateTime: 2013:09:09 10:11:41 Group 4 Options: (0 = 0x0) TIFF Directory at offset 0x27e18 (163352) Subfile Type: multi-page document (2 = 0x2) Image Width: 1728 Image Length: 2292 Resolution: 204, 196 pixels/inch Bits/Sample: 1 Compression Scheme: CCITT Group 4 Photometric Interpretation: min-is-white FillOrder: msb-to-lsb Orientation: row 0 top, col 0 lhs Samples/Pixel: 1 Rows/Strip: 2292 Planar Configuration: single image plane Page Number: 1-0 Software: GPL Ghostscript 8.70 DateTime: 2013:09:09 10:11:41 Group 4 Options: (0 = 0x0) TIFF Directory at offset 0x3a900 (239872) Subfile Type: multi-page document (2 = 0x2) Image Width: 1728 Image Length: 2292 Resolution: 204, 196 pixels/inch Bits/Sample: 1 Compression Scheme: CCITT Group 4 Photometric Interpretation: min-is-white FillOrder: msb-to-lsb Orientation: row 0 top, col 0 lhs Samples/Pixel: 1 Rows/Strip: 2292 Planar Configuration: single image plane Page Number: 2-0 Software: GPL Ghostscript 8.70 DateTime: 2013:09:09 10:11:43 Group 4 Options: (0 = 0x0)

different results because some PDF are single page other multi-page…but there’s more than that.

Interesting to know how diagnose a “Valid” PDF…if I do file filename.pdf and I read the same results and if I can open them I can say that they are reasonably “Valid” PDF (at least for some user-level applications, like a document viewer).

Dear Tony,

on a FAX sending attempt the error “TIFF/F format is not compatible” popped up once again: as happened months ago the generated PDF was made of two portrait style pages (the first page is the Coversheet and it was generated through FAX Pro, the second one was an imported image from a scanner).

Below the tiffinfo of the generated TIF file:

[root@freepbx tmp]# tiffinfo fax-1388477033207.tif TIFF Directory at offset 0x5b12 (23314) Subfile Type: multi-page document (2 = 0x2) Image Width: 1728 Image Length: 2156 Resolution: 204, 196 pixels/inch Bits/Sample: 1 Compression Scheme: CCITT Group 4 Photometric Interpretation: min-is-white FillOrder: msb-to-lsb Orientation: row 0 top, col 0 lhs Samples/Pixel: 1 Rows/Strip: 2156 Planar Configuration: single image plane Page Number: 0-0 Software: GPL Ghostscript 8.70 DateTime: 2013:12:31 09:03:54 Group 4 Options: (0 = 0x0) TIFF Directory at offset 0x2dfe0 (188384) Subfile Type: multi-page document (2 = 0x2) Image Width: 1231 Image Length: 1733 Resolution: 204, 196 pixels/inch Bits/Sample: 1 Compression Scheme: CCITT Group 4 Photometric Interpretation: min-is-white FillOrder: msb-to-lsb Orientation: row 0 top, col 0 lhs Samples/Pixel: 1 Rows/Strip: 1733 Planar Configuration: single image plane Page Number: 1-0 Software: GPL Ghostscript 8.70 DateTime: 2013:12:31 09:03:53 Group 4 Options: (0 = 0x0)

FAX’s TIF file info:

[root@freepbx tmp]# file fax-1388477033207.tif fax-1388477033207.tif: TIFF image data, little-endian

FAX’s PDF file info:

[root@freepbx out]# file fax-1388477033207.pdf fax-1388477033207.pdf: PDF document, version 1.2

Is there a way to know what are valid PDF (or TIF) file requirements in order to understand what to import and correctly send through FAX Pro?

I’m starting to have the suspect that when the imported TIF or PDF sheet (to be sent) hasn’t the same sheet size (e.g. A4 portrait) of the Cover Sheet then the reported issue rises the surface.

Thanks, Davide.

All we do is take the PDF you upload and run it through ghostscript to convert it to tiff for asterisk to send out. Not sure how you would detect if the PDF has a problem.

I agree with you but the question is: why that message if the TIF file was created on the spool folder (/var/spool/asterisk/tmp/)? It seems to me that is not the creation the issue…

I resumed an (old) log line when this strange problem first rose up few months ago with another FAX I was trying to send out:

-- Executing [s@send-fax:3] SendFAX("DAHDI/i1/0654922003-11", "/var/spool/asterisk/tmp/fax-1378500646433.tif,zf") in new stack -- Channel 'DAHDI/i1/0654922003-11' sending FAX: -- /var/spool/asterisk/tmp/fax-1378500646433.tif -- Span 1: Channel 0/2 got hangup request, cause 16 == Spawn extension (send-fax, s, 3) exited non-zero on 'DAHDI/i1/0654922003-11' -- Executing [h@send-fax:1] System("DAHDI/i1/0654922003-11", "/var/lib/asterisk/bin/faxpro_helper.php --faxid="1378500645944" --stationid="unknown" --status="TIFF/F format is not compatible" --action="sent" ") in new stack -- Hungup 'DAHDI/i1/0654922003-11'

Another question: is the FAX Cover Sheet an A4 format or what?