Knowledge base

This section contains miscellaneous information about YajHFC not included in the FAQ or other documentation.

If you did not find the answer you were looking for here, please also see the FAQ and the yajhfc-user mailing list archive.

White/black window on Windows

Especially with Windows 10 and Oracle Java 1.8 you might notice that the main window is suddenly almost completely white or black and you need to restart YajHFC to get it working again.

Usually this looks like this:
White window

This seems to be a bug in Java with the Windows native "look and feel".
To work around this issue, set Options → General → Look&Feel to "Metal" or "Nimbus".

See also YajHFC issue #47.

Database migration to 0.6.0

Version 0.6.0 and up support adding a user comment to faxes (in both sent and received tables). If the read/unread state is saved in a database table (as described in Setting up YajHFC for small workgroups), this table needs 2 new columns where this comment can be saved.

Quick summary

If you are using PostgreSQL and your table is called ReadState, run the following SQL commands:

ALTER TABLE ReadState ADD COLUMN comment VARCHAR(200);
ALTER TABLE ReadState ADD COLUMN last_modified TIMESTAMP;
ALTER TABLE ReadState ALTER COLUMN isread drop not null;

Then go to Servers->(your server)->Read/unread state + comment, click Configure... and set the new fields for Comment and Last Modified.

"Collect" multiple documents in one fax

By default, YajHFC will send one fax per document printed to the fax printer.

You can change that behaviour to "collect" multiple documents printed to the fax printer in one fax, however (with the default Windows fax printer (Redmon or RedmonEE)).

Instructions for Redmon (default)

Configure the YAJHFC: port and set Arguments for this program are to --no-wait

Step by step directions for Windows 7

  1. Open Devices and Printers, select a printer, and click Print server properties.
    Devices and Printers dialog
  2. In the dialog, open the Ports tab, select the YAJHFC: port from the list and click Configure.
    Because you will need administrator privileges to actually change anything, usually you will have to click Change port settings first.
    Print server properties dialog
  3. Enter --no-wait in the Arguments for this program are field.
    YAJHFC: properties
  4. Close all dialogs with OK.

Now YajHFC should collect all documents printed to the fax printer until you click Send. Please note that YajHFC may not come automatically on top anymore when you print to the fax printer, however.

ShellExecute error when viewing fax on Windows

When trying to open or preview a fax on Windows you may get an error message similar to the following one:

java.io.IOException: Failed to open file:/C:/Temp/user/fax1607260423703060917.tiff. Error message: Access is denied.

        at sun.awt.windows.WDesktopPeer.ShellExecute(Unknown Source)
        at sun.awt.windows.WDesktopPeer.open(Unknown Source)
        at java.awt.Desktop.open(Unknown Source)
        at yajhfc.Java6DesktopManager.open(Java6DesktopManager.java:65)
        [...]

For this article to apply the first line of the stack trace must always contains a line referring to sun.awt.windows.WDesktopPeer.ShellExecute.
The text after Error message may be different, however (for example "A device attached to the system is not functioning.")

Installing a SSL certificate in Java

When your mail server has a self signed certificate, you may get an exception like the following when trying to send a mail using the YajHFC mailer plugin:

javax.mail.MessagingException: Could not convert socket to TLS;
  nested exception is:
  javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

[...]

In that case, you will need to install the server's SSL certificate as a trusted one into Java's key store (explanation copied from http://www.grim.se/guide/jre-cert):

Logging in works, but then a connection timeout occurs

In some circumstances, you might experience the following problem:

  • Loggging into the HylaFAX server works

  • The Test connection button in the Options dialog shows a successful connection

  • But when you try to connect to the server in the YajHFC main window, you will get an error similar to:

    yajhfc.model.servconn.hylafax.HylaFaxListConnection$StatusRefresher run
    WARNING: Socket Error refreshing the status, logging out.
    java.net.ConnectException: Connection timed out: connect
      at java.net.DualStackPlainSocketImpl.connect0(Native Method)
      [...]

    Other possible errors are Network unreachable or Connection refused.

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.

Comparison of Windows fax printer options

Starting with version 0.5.2 the setup of YajHFC has three options for creating a fax printer. This article tries to give a short comparison to help you decide which one to choose.

Mode of operation

  • Redmon:
    Uses Redmon to create a virtual printer port. Redmon then launches YajHFC when a document is printed to this virtual printer port.
    Because Redmon will run as part of the Windows spooler service (which runs as the SYSTEM user), it has to switch the user id to launch YajHFC, which may lead to problems because the run environment will not be exactly the same as when YajHFC is started by the user directly.
    Also, on a terminal server, YajHFC will always be started on the console, not the session the user is logged in on.
  • RedmonEE:
    Uses RedmonEE to create a virtual printer port. RedmonEE then launches YajHFC when a document is printed to this virtual printer port.
    Usually this works better than Redmon, especially in Terminal Server environments. Unfortunately RedmonEE is beta software and 32bit only (and 64bit support not planned according to the authors).
  • mfilemon:
    Uses mfilemon to create a virtual printer port. YajHFC creates a named pipe on start. mfilemon then launches a small batch script that writes the printed data to that pipe.
    Usually this works most reliably (and probably most secure), especially in "complex" enviroments like Terminal Servers, because no user process has to be launched from the print spooler.
    The disadvantage, however, is that YajHFC must be running (e.g. be in Autostart) for the fax printer to work.

Please note that I personally can only test against default installations of the "normal" workstation versions of Windows XP/Vista/7 (YajHFC being a Open Source project I do not have the resources to do more here...).
(Terminal) Server versions should usually work, too, but I need your feedback if problems arise with such a Windows version.

Supported Java versions

Versions

Generally any Java 5, 6 and 7 should work.
Due to additional features available, using Java 6 or heigher is recommended (also Java 5 support may be dropped some time in the future).

yajhfc-console only supports Java 6 or heigher.

Implementations

YajHFC is usually tested against the JRE from Oracle for Windows (32 and 64 bit; newest version available at the time of release) and against OpenJDK for Linux (Debian; 64-bit). For Mac OS X, both the Apple and Oracle versions of Java are supported.

Automated installation using logon.bat

This article contains a short example on how to automatically install YajHFC using a Windows domain logon.bat script. It has been contributed by Stefan Agethen.

Green text has to be changed according to your system.
Blue text may be replaced by %WINDIR%
Please also note that user messages are given in German. They probably should be replaced by texts in your language.

:fax
@REM Install YajHFC
@reg query "HKEY_LOCAL_MACHINE\SOFTWARE\YajHFC" > %TEMP%\fax.tmp
@find "jarfile" "%TEMP%\fax.tmp" || @echo %DATE% %TIME% %USERNAME% %OS% FAX-ANWENDUNG FEHLT UNS MUSS INSTALLIERT WERDEN >> "t:\login.log"
@find "jarfile" "%TEMP%\fax.tmp" || @Echo msgbox "Eine FAX-ANWENDUNG wurde bei Ihnen nicht gefunden. "^& vbCrLf ^&"Ich starte die Faxinstallation."^& vbCrLf ^& vbCrLf ^&"KLICKEN SIE JETZT EINFACH IMMER AUF WEITER UND ANNEHMEN.. "^& vbCrLF ^& "Lassen Sie die Faxanwendung installieren. "^& vbCrLf ^&"Nach der Installation steht Ihnen ein Drucker zur Verfuegung mit dem Namen YAJHFC,"^& vbCrLf ^&"wenn Sie auf diesen drucken - koennen Sie sofort den Druck per Fax versenden. "^& vbCrLf ^&"Eine Bestätigung über den erfolgreichen Versand erhalten Sie per Email und Ihr Druck wird archiviert."^& vbCrLf ^& vbCrLf ^&" Stefan Agethen im November 2011.",0,"FAX-ANWENDUNG" > %TEMP%\announce.vbs
@find "jarfile" "%TEMP%\fax.tmp" || @IF exist %TEMP%\announce.vbs ping localhost -n 3 -w 1000 >NUL
@find "jarfile" "%TEMP%\fax.tmp" || @IF exist %TEMP%\announce.vbs start %TEMP%\announce.vbs
@find "jarfile" "%TEMP%\fax.tmp" || @echo Starte Installation des Fax Klienten...
@find "jarfile" "%TEMP%\fax.tmp" || @START /WAIT T:\Andere~1\HYLAFAX\automated.exe"
@find "jarfile" "%TEMP%\fax.tmp" || @mkdir "%USERPROFILE%\.yajhfc"
@find "jarfile" "%TEMP%\fax.tmp" || @copy "T:\Andere Downloads\HYLAFAX\settings.fueralle" "%USERPROFILE%\.yajhfc\settings."
@find "jarfile" "%TEMP%\fax.tmp" || @DEL "%TEMP%\fax.tmp"
@find "jarfile" "%TEMP%\fax.tmp" || @C:\WINDOWS\system32\wscript.exe "C:\Programme\YajHFC\execyajhfc2.vbs"

@REM Copy user defined settings

@if NOT exist "T:\Andere Downloads\HYLAFAX\settings.%USERNAME%" copy /Y "T:\Andere Downloads\HYLAFAX\settings.fueralle" "%USERPROFILE%\.yajhfc\settings."

goto eof

No visible tray icon in gnome-shell

In the GNOME 3 gnome-shell currently the YajHFC tray icon is not displayed. This can lead to YajHFC "disappearing" when you close or minimize the main window.

The reason is a bug in current Java implementations, see https://bugzilla.redhat.com/show_bug.cgi?id=683768 for details.

Until this is fixed in newer Java versions, currently the only known "workaround" is to disable the tray icon in YajHFC (uncheck the Display Tray icon option under Options→General).

Defining custom Modem names

In YajHFC, you can define custom modems. This can be useful in one of the following scenarios:

  • You would like to give your modems custom names instead of the default HylaFAX names (e.g. "Company A" for ttyS0, "Company B" for ttyS1)
  • You would like to make HylaFAX modem groups selectable in YajHFC.

To define custom modems, do the following steps:

  1. In the options dialog go to the Modems panel for the desired server.
  2. Check the Use the following list of modems option.
  3. Add/Modify/Remove the modems in the table as you like.
    For example: Enter the description "Company X" for the Modem with HylaFAX name "ttyS0". there).
    To add a modem group here, add a new line to the table and enter the group's name as defined in the HylaFAX configuration as HylaFAX name (similar to the predefined any modem).
  4. Click OK. You should now be able to see the modems you have defined in the modem selection list of the send dialog.