GraphiC on the Web

GraphiC allows you to send its high-resolution TKF files over the Web to anyone who has a copy of PLAY. This mode of operation has several advantages:

  • Unless you are drawing lines with too many segments, TKF files are usually smaller that a bit map, and hence transfer faster.
  • The transmitted file is the same vector TKF file that GraphiC creates so that it offers the full resolution of any GraphiC file, and it can be zoomed, printed, and converted to other formats by the PLAY on the client side.


    How to enable TKF file transmission

    There are three steps in the process. First, you need to write a perl script for your Web server. Here is a sample script that opens SAMPLE.TKF and sends it across the Web:
    open FILE, "sample.tkf";
    seek FILE, 0, 2;
    $size = tell FILE;
    seek FILE, 0, 0;
    $header = <<END;
    Content-type: image/x-tkf
    Content-length: $size
    syswrite( STDOUT, $header, length($header) );
    sysread( FILE, $data, $size );
    syswrite( STDOUT, $data, $size );
    close FILE;
    This file should be placed in your Server's cgi-bin or scripts directory.

    Next, you must add the new Mime type to both your Web Server and Browser. The type is image/x-tkf.
    For example, in your Netscape Communicator Browser under the View, Preferences popup, select under Navigator Applications, New Type

    Fill in the following information:

    Extension TKF
    MIME Type: image/x-tkf
    Handled By Application: <full path to PLAY.EXE> %s
    Be sure to change the executable to match that installed on your system, e.g., PLAYWNT.EXT on NT or Windows '95.

    Finally, you must add a matching Mime Type on your Web Server.

    For example, in the Microsoft Personal Web Server (4.0), in the Microsoft Management Console, right click on the computer name under the IIS folder, and open the Properties popup. Select the File Types... button.

    Under New Type..., fill in the Associated Extension .tkf and the Content Type image/x-tkf.

    Finally, you need to have a copy of perl running on your web server.

    Back to the GraphiC Home Page