TIPS Poor outgoing PDF fax quality with Hylafx/Avantfax.

RoboLord

Member
Joined
Aug 18, 2017
Messages
56
Reaction score
5
Hey there- I managed to get faxing setup on my new Incredible PBX for Rasbian install. I have a Comcast business ISP and am using VoIP.ms for SIP Trunking. My initial testing faxes are unfortunately of such poor quality that I don't think I will be able to use this system as is. I'm curious what steps I can take to improve the quality?

This image shows the original PDF from my scanner:
PDzzmWx.png


This is the PDF that was sent from Hylafax to my eFax account. As you can see, it's almost unreadable. Please note that we receive faxes at this number that are usually much better quality so I don't believe it's on the receiving end.
o1MAhkL.png


Here's an incoming fax sent the opposite direction, from eFax to Hylafax. As you can see the image quality is much higher.
nE4bYxP.png


So the question is, is this a setting in Hylafax that's causing the degradation? Is it a problem with my ISP or VoIP.ms? What can I do to fix it? Thanks!
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
Check that you have a VRes = 196 in your hfaxd.conf it would (unnecessarily, it it will negotiate that with the far end) try to force 196 dpi, but if efax is only sending standard resolution then you are hosed.
 

RoboLord

Member
Joined
Aug 18, 2017
Messages
56
Reaction score
5
Check that you have a VRes = 196 in your hfaxd.conf it would (unnecessarily, it it will negotiate that with the far end) try to force 196 dpi, but if efax is only sending standard resolution then you are hosed.

Any ideas where hfax.conf would be located in my Raspbian install? It's not shown in the "Config Edit" menu in Incredible/FreePBX. Also, just to be clear, the fax coming from eFax to my PBX/Hylafax looks pretty good. It's the outgoing from Hylafax that is unreadable. I'm unclear what eFax's sending dpi would have to do with it. Thanks!
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
Any ideas where hfax.conf would be located in my Raspbian install? It's not shown in the "Config Edit" menu in Incredible/FreePBX. Also, just to be clear, the fax coming from eFax to my PBX/Hylafax looks pretty good. It's the outgoing from Hylafax that is unreadable. I'm unclear what eFax's sending dpi would have to do with it. Thanks!



apt-get install -y locate; updatedb;locate hfax.conf

But for ,whatever reason your fax is only being received at 98 VRes that's why it looks like that sendfax accepts arguments of -l (low 98) -m (medium 196) and -G (the highest resolution both machines can use), further to that the log files in /var/spool/hylafax/log/c* should fully identify the negotiated resolution af any particular fax.
 

RoboLord

Member
Joined
Aug 18, 2017
Messages
56
Reaction score
5
I located the HylaFax folder in /etc/hylafax
There was no hfax.conf but I did find sendfax.conf

I found a post on a different forum that suggested I add this to sendfax.conf
Code:
VRes:        196.
It's a shame this option isn't exposed in the AvantFAX gui.


I don't know much about what I'm seeing in those logs but I did notice a couple differences before and after making the change.

Before:
Code:
Nov 29 10:18:19.61: [ 5343]: REMOTE best rate 14400 bit/s
Nov 29 10:18:19.61: [ 5343]: REMOTE max A4 page width (215 mm)
Nov 29 10:18:19.61: [ 5343]: REMOTE max unlimited page length
Nov 29 10:18:19.61: [ 5343]: REMOTE best vres R16 x 15.4 line/mm
Nov 29 10:18:19.61: [ 5343]: REMOTE format support: MH, MR
Nov 29 10:18:19.61: [ 5343]: REMOTE best 0 ms/scanline
Nov 29 10:18:19.61: [ 5343]: USE 14400 bit/s
Nov 29 10:18:19.61: [ 5343]: SEND file "docq/cover2;c0"
Nov 29 10:18:19.61: [ 5343]: USE A4 page width (215 mm)
Nov 29 10:18:19.61: [ 5343]: USE unlimited page length
Nov 29 10:18:19.61: [ 5343]: USE 3.85 line/mm
Nov 29 10:18:19.61: [ 5343]: USE 2-D MR
Nov 29 10:18:19.61: [ 5343]: USE 0 ms/scanline
Nov 29 10:18:19.61: [ 5343]: SEND training at v.17 14400 bit/s

Nov 29 10:18:37.73: [ 5343]: SEND file "docq/doc3.pdf;c0"

After:
Code:
Nov 29 14:39:27.90: [ 9341]: REMOTE best rate 14400 bit/s
Nov 29 14:39:27.90: [ 9341]: REMOTE max A4 page width (215 mm)
Nov 29 14:39:27.90: [ 9341]: REMOTE max unlimited page length
Nov 29 14:39:27.90: [ 9341]: REMOTE best vres R16 x 15.4 line/mm
Nov 29 14:39:27.90: [ 9341]: REMOTE format support: MH, MR
Nov 29 14:39:27.90: [ 9341]: REMOTE best 0 ms/scanline
Nov 29 14:39:27.90: [ 9341]: USE 14400 bit/s
Nov 29 14:39:27.90: [ 9341]: SEND file "docq/cover4;c1"
Nov 29 14:39:27.90: [ 9341]: USE A4 page width (215 mm)
Nov 29 14:39:27.90: [ 9341]: USE unlimited page length
Nov 29 14:39:27.90: [ 9341]: USE 7.7 line/mm
Nov 29 14:39:27.90: [ 9341]: USE 2-D MR
Nov 29 14:39:27.90: [ 9341]: USE 0 ms/scanline
Nov 29 14:39:27.90: [ 9341]: SEND training at v.17 14400 bit/s

Nov 29 14:39:51.10: [ 9341]: SEND file "docq/doc7.pdf;c1"

You'll see that it changed from to 3.85 to 7.7 line/mm
Also, "docq/doc3.pdf;c0" changed to "docq/doc7.pdf;c1"

I assume the c1 indicates a higher res.
Here's the result: it's far better than the previous sent image but still not as good as the incoming one (both were 7.7 line/mm
oR0WLCY.png


Are there any other changes I can make to improve the quality of the conversion? Thanks!
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
If you don't correct your . . . . /includes/local_config.php to use letter , timestamps etc, to reflect your locale then you will continue to need ghostscript to translate A4 to letter and wonder why David Mimms is stupid enough to use European conventions, you could add -G to your sendfax args but there is no guarantee that it will be honored becazuse the"far end" actually said

REMOTE best vres R16 x 15.4 line/mm

but you decided to

USE 7.7 line/mm

you said

VRes: 196.

it should technically be

VRes:/t196

don't add things (.) and use tab not spaces between the key and the value
 
Last edited:

RoboLord

Member
Joined
Aug 18, 2017
Messages
56
Reaction score
5
Thanks for the pointers. I checked out /includes/local_config.php and it was pre-set to letter, not A4 so that's good.
A couple more questions--
Where would I put the "-G" if I wanted to send at highest quality settings?
Is send fax.conf the correct place to put "VRes:/t196" or is there a better location? I read about creating "/var/spool/hylafax/etc/FaxModify"
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
I apologize for the typo

/usr/lib/fax/hfaxd.conf (or whatever locate reports, I use hylafax+ , you might not)

is where you would do that

for the -G , I suggest you could edit

..../.../includes/functions.php:
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
Because it is more functional/dynamic, because it is guided by a human and because I'm a little left of center :) .
 

RoboLord

Member
Joined
Aug 18, 2017
Messages
56
Reaction score
5
I apologize for the typo

/usr/lib/fax/hfaxd.conf (or whatever locate reports, I use hylafax+ , you might not)

My HylaFax install (non-+ version) does not have a hfaxd.conf file anywhere in the system. In any event, I think I got it working with the weird tab spaced config line I added to /etc/sendfax.conf

Ultimately, it turns out the real problem I'm having appears to be coming from the dithering settings when converting documents from color/grayscale to duotone in Ghostscript. I discovered this by scanning a document directly to duotone and faxing it at 196dpi. It looks fantastic. Now I'm curious if it's possible for me to fix the dithering issue in case someone in the office tries to send something that's not pre-converted to duotone. I found references to adding a line "DITHERING=libtiff-fs" to "/var/spool/hylafax/etc/FaxModify", however, it appears this is a Hylafax Enterprise only option. I poked around for quite a while trying to find any place to tinker with the Ghostscript settings, to no avail. Any ideas what can be done and where to find it? Thanks!

For reference, here's the fax sent at 196dpi, pre-converted to duotone by my scanner:
nx0sazo.png

definitely good enough for my purposes!
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
ImageMagick can do that on your original pdf

convert -monochrome input.pdf output.pdf

ghostscript can do it also by adding -sDEVICE=psmono to the call to it, but as I said before, make sure your ghostscript is not 10 years old ;-)
 

RoboLord

Member
Joined
Aug 18, 2017
Messages
56
Reaction score
5
ImageMagick can do that on your original pdf

convert -monochrome input.pdf output.pdf

ghostscript can do it also by adding -sDEVICE=psmono to the call to it, but as I said before, make sure your ghostscript is not 10 years old ;-)
Thanks, but I have no idea how to implement that into the faxing workflow. Do I just stick this line of code into one of the config files?
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
If you are using Avantfax , in

/var/www/html/fax/includes/functions.php

is a function convertpdf, I would add it in there.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Thanks, but I have no idea how to implement that into the faxing workflow. Do I just stick this line of code into one of the config files?

For GhostScript conversion, change DEVICE from pswrite to psmono here: /etc/hylafax/faxmail/application/pdf

Might also want to change PAPERSIZE from a4 to letter or legal (depending on your country and requirements, of course)
 
Last edited:

RoboLord

Member
Joined
Aug 18, 2017
Messages
56
Reaction score
5
Things are much different on Raspbian, it seems.

/var/www/html/fax/includes/functions.php
is actually:
/var/www/html/avantfax/includes/functions.php
unfortunately I have no php coding skills and am not comfortable slipping lines into that file. I'm sure I would break it!

/etc/hylafax/faxmail/application/pdf

is non-existent on my system and I'm not sure where it's equivalent would be located. I used locate to try to find "pdf" and I can't find any files that would have these options to edit. Any ideas where this might be in a Raspbian system?

I did find the file /etc/hylafax/pagesizes and was able to switch the default to from A4 to US Letter.
 

dicko

Still learning but earning
Joined
Oct 30, 2015
Messages
1,607
Reaction score
826
Things are much different on Raspbian, it seems.

/var/www/html/fax/includes/functions.php
is actually:
/var/www/html/avantfax/includes/functions.php
unfortunately I have no php coding skills and am not comfortable slipping lines into that file. I'm sure I would break it!

/etc/hylafax/faxmail/application/pdf

is non-existent on my system and I'm not sure where it's equivalent would be located. I used locate to try to find "pdf" and I can't find any files that would have these options to edit. Any ideas where this might be in a Raspbian system?

I did find the file /etc/hylafax/pagesizes and was able to switch the default to from A4 to US Letter.
Not so much the included file with avantfax , debian-prefs.txt is how to choose a few basics, in my case I choose fax over avantfax and change the apache user/group to asterisk
 

RoboLord

Member
Joined
Aug 18, 2017
Messages
56
Reaction score
5
For GhostScript conversion, change DEVICE from pswrite to psmono here: /etc/hylafax/faxmail/application/pdf
Hey Ward, any idea where this might be found on a Raspbian install? I can't find it in my system
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Google is your friend. Take a look at /etc/hylafax/typerules.
 

Members online

Forum statistics

Threads
25,778
Messages
167,504
Members
19,198
Latest member
serhii
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top