Unable to convert pdf to tiff for FAX


As I read the document ‘digium fax for asterisk’ and tried to issue command for converting pdf file to tiff but I’m getting error listed below;

[root@rltd114 ~]# gs -q -dNOPAUSE -dBATCH -sDEVICE=tiffg4 -sPAPERSIZE=letter -sOutputFile=/tmp/out.tiff /tmp/in.pdf
**** Warning: An error occurred while reading an XREF table.
**** The file has been damaged. This may have been caused
**** by a problem while converting or transfering the file.
**** Ghostscript will attempt to recover the data.
ERROR: /undefined in /BXlevel
Operand stack:
70 0 1 --dict:6/6(ro)(G)-- obj
Execution stack:
%interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push --nostringval-- %loop_continue --nostringval–
Dictionary stack:
–dict:1122/1686(ro)(G)-- --dict:0/20(G)-- --dict:107/200(L)-- --dict:107/200(L)-- --dict:104/127(ro)(G)-- --dict:241/347(ro)(G)-- --dict:18/24(L)–
Current allocation mode is local
ESP Ghostscript 815.02: Unrecoverable error, exit code 1

Even I tried ‘-g’ option and setting paper size to A4 in command but still giving me same error.
Further added, I also attempted to convert pdf files that were already stored in my Linux box but still unable to convert it.

Please advice, how I can overcome with this error.

I updated the version of ghistscript now its working fine.

A thing I would like to know, is there a way to send fax in .tiff format using capicommand? The card I’m using is Dialogic Diva T1. As I tried to send fax in .tiff format I usually received fax in binary format on other hand, send fax in .txt format receiving in ascii format and in readable form. The protocol I’m using to transmitting fax is T.30 and the dial plan is listed below;

exten => 100,1,Verbose(::::::::::::> Sending Dialogic Diva Fax…)
exten => 100,n,set(BeforeFaxTime=${EPOCH})
exten => 100,n,capicommand(sendfax,/tmp/out.tiff,732-XXX-XXXX,Dialogic Diva Test Sendfax)
exten => 100,n,HangUp()
exten => h,1,set(ElapsedFaxTime=$[${EPOCH}-${BeforeFaxTime}])

Please advice at earliest.

Any update to this issue?