HylaFAX The world's most advanced open source fax server

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [hylafax-users] hylafax 6 and landscaped pages



max wrote:

I’m sending faxes through YAJHFC client.


I don’t know if the problem is due to the client or to hylafax.

There is a strange problem when I try to send a fax where the cover page is vertical

and page 2, for example, is instead horizontal.

The document that I see in preview is exactly like that, and it is displayed perfectly.

On the receiver side it doesn’t.

The second page is incomplete, I mean that page 2 is vertical and, obviously

there is 2 very large borders at left and right of the original text that are missing.

How can I tell to hylafax to automatically rotate landscaped pages?


The question of whether or not this is a problem with the client depends, I suppose, on whether or not the rotate-to-portrait behavior is expected of the server. I would suggest that it is. Therefore, in my opinion the proper handling of landscape pages is a responsibility of the server.


This is a problem that we've been hitting on for quite some time with HylaFAX. And the problem has to do with a combination of Ghostscript's limitations with the limitations of fax operation. Here are some comments from the HylaFAX+ common-functions code...

#
# The image must end up with a pixel width according to T.32 Table 21.
# Ghostscript contains code to fixate a4 and letter to 1728 pixels
# when using 196-204 dpi and tiffg3/4, it supposedly does the same for
# B4 but not for A3, thus the floats are needed (for A3's benefit).
#
# See ghostscript/doc/Devices.htm under -dAdjustWidth=1 (default).
# Use -dAdjustWidth=0 to disable. With the right patch,
# http://bugs.ghostscript.com/show_bug.cgi?id=688064
# AdjustWidth can be made to specify the pagewidth directly and
# replace -dFIXEDMEDIA to permit TIFFs to be produced with
# varied lengths.
#
# Another alternative to -dFIXEDMEDIA is -dPDFFitPage which has the
# difference of "resizing" images to fit the page rather than cutting
# them off.
#
# And yet another alternative is to use FIXEDWIDTH='bin/auto-rotate.ps'
# which should rotate all pages to portrait and adjust to fit A4 page
# size. (Mixed page sizes are not supported by it.)
#

In other words, because fax has fixed-pixel-width limitations which really do not exactly match standard page size widths Ghostscript has hard-coded certain behaviors for fax purposes into the tiffg3 and tiffg4 drivers. These hard-coded behaviors defeat the typical automatic page rotation or page resizing features in Ghostscript, but they are of benefit to the vast majority of all fax uses (non-fax users find these behaviors troublesome) - the exception to that benefit being when the pixel width of the source image is greater than the fixed-pixel-width limitation in the fax protocol (typical with landscape-rotated pages).

In retrospect it would have been better if the Ghostscript tiffg3 and tiffg4 drivers had not implemented any of these behaviors on behalf of fax users and required fax users to dynamically adjust resolution to get the right pixel-width pages. However, that opportunity is now gone, and so many fax users depend on these behaviors that they really can't be torn out. So we have to cope with what we have.

The most-effective, simple, and reliable coping method right now is to use "FIXEDWIDTH=-dPDFFitPage" option in /var/spool/hylafax/etc/FaxModify. Unfortunately, that doesn't rotate pages. It merely resizes them to fit on the page. But that way at least nothing gets cut off. Unfortunately, that may render text too small to be legible.

The real answer is to either preprocess the image before feeding it to Ghostscript's tiffg3/tiffg4 drivers (and this preprocessing could be with Ghoscript, I suppose) or to provide auto-rotation Postcript code to Ghostscript with the image that will augment Ghostscript's default behaviors. This latter idea is what is behind the "FIXEDWIDTH=bin/auto-rotate.ps" feature that was introduced into HylaFAX+ 5.3.0. Unfortunately, this feature does not work for most mixed-rotation documents.

So for now my recommendation would be to use the -dPDFFitPage option and to send me a copy of the mixed-rotation document so that I can try my hand again at figuring out what to do.

I feel obliged to also point you at one user's solution to this problem:

http://article.gmane.org/gmane.comp.telephony.fax.hylafax.user/31816

I don't necessarily endorse this approach, however, in particular because it employs ImageMagick's convert tool rather than limiting itself to Ghostscript and libtiff which is already on every HylaFAX user's system.

Thanks,

Lee.



____________________ HylaFAX(tm) Users Mailing List _______________________
 To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
 *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*




Project hosted by iFAX Solutions