AMT Help Files

Print File Hook

The PrintFileHook is an optional DLL that, when set, will be called before data is send to the printer. This makes it possible to manipulate the print data before it is printed.

With a PrintFileHook you could for example add escape sequences, change certain text or characters, automatically reduce font size and so forth.

Currently to make full use of a PrintFileHook, you must send the print requests from the comscript library to be able to send parameters with the request.

 

Creating a PrintFileHook

PrintFileHooks are very customer specific and for most cases have been created during the migration projects, but it is possible to create one yourself.

The created PrintFileHooks must adhere to the following criteria's:


An example of the mandatory sections:

 

  ///<summary>
  /// Hook for every file that is printed by the printcontroller.
  ///</summary>
  public class PrintFileHook {
    ...
    ...
    ...

    /// <summary>
    /// Called by the printcontroller before a file is printed.
    /// </summary>
    /// <param name="data">print data</param>
    /// <param name="station">station</param>
    /// <param name="user">user</param>
    /// <param name="printer">printer</param>
    /// <param name="parameter">parameter</param>
    ///<returns>modified print data</returns>
    public String ModifyPrintData (String data, String station, String user, String printer, String parameter) {
      ...
      ...
      ...
      return (result);
    } // ModifyPrintData
 
  } // Class PrintFileHook