LTSP Kiosk
Introduction

Basic Setup
Server-side Changes
Client-side Changes
Adding New Clients

Additional Features
Locking FireFox
PDF Support
Background Image
Printing

Advanced Issues
Securing Connection
Client Firewall
Detect Kiosk Idle
Booting Clients Remotely

Tailored Tools

Reading PDF files

Theory of operation

Basically, allowing kiosk users to access PDF documents is not a big challenge for LTSP kiosk. You have to install the necessary binaries to the client tree, set the browser to utilise the executable and off you go.

Since LTSP kiosk does not have any access to the hard disk, all temporary files must be saved to the ramdisk. Obviously, the size of the ramdisk is at least a theoretical limit. To save the ramdisk space, the client should be configured so that it contains only the current PDF file and makes garbage collection (deletes the file) after the PDF rendered has ended (the user has exited the PDF reader program).

This can be easily achieved by executing the PDF reader through the following wrapper script:

#!/bin/sh

/usr/bin/xpdf $1
rm -f $TEMP/*

However, my current script is a bit more complicated, since there are two versios of xpdf: one binary with printing disabled and other with safe printing enabled (user can't change the print queue settings).

#!/bin/sh

. /etc/ltsp_functions

PRINTER_LDP=`get_cfg PRINTER_LDP none`

if [ "$PRINTER_LDP" == "" -o "$PRINTER_LDP" == "none" ]; then
	/usr/bin/xpdf-noprint $1
else
	/usr/bin/xpdf-print $1
fi

rm -f $TEMP/*.pdf

Some notes:

  • The 3.01 kiosk patches do not contain XPDF_KIOSK_PRINT environment variable which was used in 3.00 patch. The printer setting is done using psFile directive in the /tmp/xpdfrc.
  • The psFile setting should point to your printer client (see sampe xpdfrc in the bottm of the page and the separate document about printing)

To make the browser (Firebird) to save all files to the desired directory, you have to set the TEMP variable accordingly before executing Firebird in xinitrc, e.g.

export TEMP=/tmp/home/tmp_moz
export TMPDIR=$TEMP
/usr/local/firebird/firebird
mkdir $TEMP

Unfortunately, Xpdf uses another environment variable (TMPDIR) for temp directory. Thus, you have to set this as well.

The LTSP default for ramdisk is 1024 kb which is not enough for storing PDF files.When increasing the ramdisk size you have to make the change to two settings:

  • ramdisk_size=N in kernel parameters
  • lts.conf has parameter RAMDISK_SIZE which has to be changed as well. The default value is 1024.

Patch to Xpdf 3.02pl1

In this project I used Xpdf, since its source is available for patching. The changes are done in XPDFViewer.cc and GlobalParams.cc files which implements the user interface.

For older patches see the xpdf directory.

Compiling Xpdf RedHat 7.3 / Debian 3.0

This section describes how to compile Xpdf.

RedHat 7.3:
You need openmotif and freetype packages (both binary and devel versions). In T1 library is not available for 7.3 as package (at lest I didn't found) so you have to compile it as well. The library is available from the XPDF download page. You may want to use following parameter in configuring T1:

./configure --host=i586-pc-linux-gnu

Debian 3.0:
Install following packages:

lesstif1
lesstif-dev
libfreetype6
libfreetype6-dev
t1lib1
t1lib-dev

Configure Xpdf with following parameters:

./configure --enable-a4-paper \
	--with-freetype2-includes=/usr/include/freetype2 \
	--with-t1-library \
	--sysconfdir=/etc

Then run make as usual.

To make XPDF operarational you have to copy following libraries:

RedHat 7.3:

cp /usr/X11R6/lib/libXm.so.3 /opt/ltsp/i386/usr/X11R6/lib/
cp /usr/lib/libfreetype.so.6 /opt/ltsp/i386/usr/lib/
cp /usr/lib/libstdc++-libc6.2-2.so.3 /opt/ltsp/i386/usr/lib/
cp /usr/local/lib/libt1* /opt/ltsp/i386/usr/lib/ [*]

[*] Note: By default, T1 library was installed to /usr/local/lib.

Debian 3.0:

cp /usr/lib/libXm.so.1 /opt/ltsp/i386/usr/lib/
cp /usr/lib/libstdc++-libc6.2-2.so.3 /opt/ltsp/i386/usr/lib/
cp /usr/lib/libt1.so.1 /opt/ltsp/i386/usr/lib/

You may need to copy more libraries if you haven't installed Firebird before. To see which libraries you heed, run ldd against just-compiled Xpdf executable. The ltsacp tool helps you in this. The tool can be found from the LTSP contrib area.

After you've copied all libraries to client tree, re-make the link cache:

/sbin/ldconfig -r /opt/ltsp/i386

To make the binary smaller, you may want to remove the xpdf debug symbols by entering

strip xpdf/xpdf

Finally, copy the compiled Xpdf executable to  /opt/ltsp/i386/usr/bin/

Finishing Xpdf installation

Xpdf needs T1 fonts to be installed (RH 7.3: urw-fonts, Debian 3.0: gsfonts). For this, you have to create a xpdfrc file to client's /etc directory. For details see Xpdf site. Don't forget to copy the fonts to client tree. I placed them into /opt/ltsp/i386/usr/share/t1fonts.

Here is my /etc/xpdfrc (acquired directly from Xpdf documentation with changed path):

displayFontT1 Times-Roman /usr/share/t1fonts/n021003l.pfb
displayFontT1 Times-Italic /usr/share/t1fonts/n021023l.pfb
displayFontT1 Times-Bold /usr/share/t1fonts/n021004l.pfb
displayFontT1 Times-BoldItalic /usr/share/t1fonts/n021024l.pfb
displayFontT1 Helvetica /usr/share/t1fonts/n019003l.pfb
displayFontT1 Helvetica-Oblique /usr/share/t1fonts/n019023l.pfb
displayFontT1 Helvetica-Bold /usr/share/t1fonts/n019004l.pfb
displayFontT1 Helvetica-BoldOblique /usr/share/t1fonts/n019024l.pfb
displayFontT1 Courier /usr/share/t1fonts/n022003l.pfb
displayFontT1 Courier-Oblique /usr/share/t1fonts/n022023l.pfb
displayFontT1 Courier-Bold /usr/share/t1fonts/n022004l.pfb
displayFontT1 Courier-BoldOblique /usr/share/t1fonts/n022024l.pfb
displayFontT1 Symbol /usr/share/t1fonts/s050000l.pfb
displayFontT1 ZapfDingbats /usr/share/t1fonts/d050000l.pfb
psFile "|/usr/bin/rlpr-kiosk"

Updated: 2-AUG-2007