KeyJnote Documentation

http://keyjnote.sourceforge.net/
Version: 0.9.4
Author: Martin J. Fiedler
Last updated: 2007-03-19

Table Of Contents

  1. Synopsis
  2. Requirements
  3. Installation
  4. Command Line Parameters
  5. Usage
  6. Info Scripts
  7. Other Useful Information

Synopsis

KeyJnote is a simple presentation program that displays slideshows of image files (JPEG, PNG, TIFF and BMP) or PDF documents. Rendering is done via OpenGL, which allows for some “eye candy” effects.

Requirements

The following software packages are required or recommended to use KeyJnote:

Debian users can install all these packages at once by typing
apt-get install python python-opengl python-pygame python-imaging gs pdftk

Windows users can download a “batteries included” ZIP file containing all necessary libraries instead of the standard source code distribution of KeyJnote.

In addition to these software requirements, the following hardware requirements exist:

Installation

The installation procedure differs betweed Windows and “generic” Unix systems.

Generic Installation

After installing the prerequisites mentioned in the last chapter, extract the file keyjnote.py from the downloadable archive. You can either start it directly or copy it to some location in your $PATH (~/bin or /usr/local/bin are good candidates).

To start a presentation, simply type something like
keyjnote.py demo.pdf

Windows Installation

Download the ZIP file of the Windows version and extract it into a folder of your choice. There is an executable file called keyjnote.exe in this directory. You can either directly drop PDF files or directories containing image files on this .exe in Explorer, or you install a link to keyjnote.exe in your “Send To” Menu (usually C:\Documents and Settings\YourNameHere\SendTo). Using the latter method, you can start a presentation by right-clicking a PDF file and selecting “Send To / KeyJnote”.

Prebuilt Packages

Some Linux Distributions are already including KeyJnote into their standard package repositories. For example, if you are using Debian or Gentoo, you may succeed installing the program with a mere apt-get install keyjnote or emerge keyjnote. However, note that these packages are not mainained by the program's author and may be outdated.

Command Line Parameters

When used from the command line (some terminal and shell in Unix, cmd.exe on Windows), KeyJnote accepts a range of command-line options in GNU getopt syntax.

The last parameter specified on the command line must be either the name of an (existing and readable) PDF file, or the name of an (existing, browseable and readable) directory that contains image files to display.

The following options are available (in alphabetical order):

-a <seconds> or --auto <seconds>
Automatically advance to the next page after the given number of seconds. Together with the -w option (described below), this can be used to create automatic slideshows.
-A <X>:<Y> or --aspect <X>:<Y>
Specifies the display aspect ratio. Normally, KeyJnote assumes that pixel aspect ratio is 1:1 (square pixels), regardless of the display resolution that was set up. If a resolution has been selected that doesn't match the display's aspect ratio, the screen will be distorted. To overcome this, this option may be used to manually specify the display aspect ratio, e.g. »-A 16:9«.
-b or --noback
Disabled background rendering. By default, KeyJnote will pre-render all pages in a separate background thread while the presentation runs. If this option is specified, it will instead render all pages immediately on startup. This option has no effect if caching is disabled (-c option).
-B <ms> or --boxfade <ms>
Sets the duration (in milliseconds) of the highlight box fade-in/fade-out animation. Default value: 100 ms.
-c or --nocache
Turns off the page cache. By default, KeyJnote pre-renders all pages of the document or slideshow on startup (with -b) or during the presentation (without -b). If this option is used, pre-rendering is not performed. Instead, KeyJnote will only keep two pages in RAM: The currently displayed one, and the following one. This will introduce a notable delay when cycling through the pages, because they have to be rendered on demand. Additionally, the overview page will not be complete and show up placeholders until each page has been rendered at least once.
-C <filename>[:<X>,<Y>] or --cursor <filename>[:<X>,<Y>]
This option can be used to specify the path to an image file (typically a transparent .png) that shall be used as the mouse cursor instead of the default one. Optionally, the hotspot may be specified (this is the position inside the cursor image where the real mouse position is located). Example: --cursor mycursor.png:2,4
-d <time> or --duration <time>
Specifies the expected run time of the presentation. The time parameter can be either a number of seconds or a human-readable time like 1:23 (1 minute and 23 seconds), 4:56h (4 hours and 56 minutes), 3m45s (3 minutes and 45 seconds), 5m (5 minutes) or 1:23:45 (1 hour, 23 minutes and 45 seconds).
If an expected duration is specified, KeyJnote will show a semi-transparent green progress bar at the lower edge of the screen, indicating how much time has already passed. If the time is up, the bar will occupy the whole edge and fade to yellow (at 125% of the expected time) to red (at 150% or more).
-D <ms> or --mousedelay <ms>
Sets the time (in milliseconds) the mouse cursor is shown in fullscreen mode if it is not moved. Default value: 3000 ms.
-e or --noext
OpenGL normally only supports textures with power-of-two dimensions. This means that for a 1024x768 screen, the actual texture size will be 1024x1024, for 1600x1200 it will even be 2048x2048. To overcome this limit and save texture memory, KeyJnote will automatically use the more advanced OpenGL extensions GL_ARB_texture_rectangle (available on most graphics cards) or GL_ARB_texture_non_power_of_two (available on modern graphics cards with current drivers). If these cause any trouble, the -e option may be used to prevent KeyJnote from using the problematic extensions.
-f or --fullscreen
Toggles fullscreen mode. By default, fullscreen mode is activated, and can be deactivated using this switch.
Note: On Windows systems, toggling fullscreen mode while KeyJnote runs does not work. So, this option is the only way to set whether fullscreen mode shall be used or not.
-F <file> or --font <file>
KeyJnote uses some kind of text OSD to overlay the current page number and title (if available) on the overview page. This option can be used to specify a TrueType font file (.ttf) to use for the OSD. If the path specified doesn't directly point to a useable font file, KeyJnote will try to search the system font directories. On Unix-like systems, it assumes that all fonts are stored below /usr/share/fonts or /usr/local/share/fonts for this purpose. If this option is not specified, Verdana.ttf will used as a default if the operating system is Windows, or Vera.ttf (the typical file name of Bitstream Vera Sans) if it's not.
-g <width>x<height> or --geometry <width>x<height>
Sets the screen size or resolution KeyJnote shall use (in pixels). On Win32 platforms, the default screen size for fullscreen mode is the current screen resolution; on other platforms, KeyJnote uses the highest resolution available to the graphics system. If a standard resolution cannot be determined, the default is 1024x768 pixels. Note that this option is not the standard X “geometry” option and does therefore not support window positioning (e.g. -g 800x600+0-0 will not work!).
-G <gamma>[:<blacklevel>] or --gamma <gamma>[:<blacklevel>]
Sets up the startup gamma and (optional) black level value. The black level is the original image's intensity level (0...254) that is to be mapped to black in KeyJnote's output. Note that gamma and black level adjustments may be inavailable or constrained on some systems.
-h or --help
If this option is specified, KeyJnote writes a short command line help screen to standard output and does not start a presentation.
-i <page> or --initialpage <page>
Specifies the page number to start with. The default value is 1 (start with the first page). If another value is specified, the page shown by KeyJnote right after initialization is not the first one of the PDF or image list. Additionally, pre-rendering (if enabled) will also start at the specified page.
-l or --listtrans
If this option is specified, KeyJnote writes a list of all available transition classes to standard output and does not start a presentation.
-m or --memcache
By default, KeyJnote caches all pre-rendered pages in a temporary file on disk. If the disk is very slow or disk space is low, but memory is abundant, this option instructs KeyJnote to cache all page images into memory. This option has no effect if caching is disabled (-c option).
-o <directory> or --output <directory>
Do not display the presentation, but render it into a series of PNG image files inside the specified directory. The images will be generated in the current resolution as specified by the -g option. This option is useful if you're going to give a presentation on a foreigh PC with an old, broken or otherwise problematic GhostScript installation: By generating images of the PDF pages you can ensure that no rendering bugs will happen on the target system.
-p <start>-<end> or --pages <start>-<end>
Using this option, the range of the page displayed can be narrowed down. The presentation will start at the first page in the range. All pages outside of the range will not be shown on the overview page and will not be cached. However, they can be entered manually when cycling through the presentation. Due to the fact that these pages are uncached, preparation of the display will take considerably longer.
-P <path> or --gspath <path>
This option can be used to override the GhostScript path autodetection. The full path to the GhostScript executable (gs or gs.exe) must be specified.
-r <n> or --rotate <n>
Display all pages rotated by n×90 degrees clockwise. Try -r 1 or -r 3 if you run into problems with PDFs generated by LaTeX on some GhostScript versions.
-R <X>x<Y> or --meshres <X>x<Y>
Most effects subdivide the visible screen into a mesh of rectangular or quadratic pieces, each with its own coordinates and alpha blend values. Using this parameter, the resolution of the subdivision mesh can be defined. The default value is 48x36. On slow machines, lower values like 24x18 or 12x9 can heavily speed up transition rendering at the cost of visual quality. On the other hand, higher values like 64x48 or 96x72 improve quality, but use much more CPU cycles.
-s or --scale (image input only)
If a directory with image files is used as input, KeyJnote will scale down images that are too big for the screen. But by default, it will not scale up smaller images to fit the screen; it will leave a black border instead. This option overrides this setting and enables upscaling of smaller images.
-s or --supersample (PDF input only)
This switch enables antialiating by 4x supersampling instead of the normal multisampling method used by GhostScript. While this usually degrades both visual quality and performance, it may be necessary for circumventing white strips or moiré-like patterns in gradients.
-S <pixels> or --fontsize <pixels>
This option sets the size, in pixels, of the OSD font. The default value is 14.
-t <ms> or --transition <trans1[,trans2...]>
Using this switch, the set of transitions KeyJnote will randomly draw at page changes can be specified. If only one transition class is specified, this class will be used for all pages that do not have another transition explicitly assigned in their page properties. Multiple transitions have to be separated by commas; they will be used in random order. The -l option can be used to get a list of available transitions.
-T <ms> or --transtime <ms>
Sets the duration (in milliseconds) of page transitions. Default value: 1000 ms.
-u <seconds> or --poll <seconds>
If this option is specified, the source file or directory will be checked for changed regularly. If a change in the input PDF file or any of the image files in the input image directory is detected, the page cache will be flushed and the current page as well as the info script will be reloaded. The current page's transition will be shown between the old and the new version of the page.
The new PDF file must have at least as much pages as the old one; also, it should have the same aspect ratio. If the input is a directory, image files must not have disappeared.
-w or --wrap
If this option is set, KeyJnote will “wrap” over to the first page after the last page. In other words, advancing to the next page at the end of the presentation will restart the whole presentation.
-Z <ms> or --zoom <ms>
Sets the duration (in milliseconds) of the overview page zoom-in/zoom-out effects. Default value: 250 ms.

Usage

On startup, KeyJnote will display a black screen with the program logo at the center. If caching is enabled, but background rendering is disabled, all pages of the presentation will be rendered once. A bar at the lower edge of the screen displays the progress of this operation. Any key (except for Q and Esc) or mouse click skips this process, with the effect that KeyJnote will render the remaining pages on demand. Please note that the overview page will not be complete until every page has been rendered at least once. In other words, if the precaching process was skipped, placeholders will be displayed for all pages that have not been rendered yet. By default, KeyJnote will build up the cache in the background while the presentation runs. Thus, the progress bar will not appear and the preparation will only take the amount of time required to render the first two pages of the presentation.

After this initialization process, KeyJnote will switch to the first page directly and without any transition. The following keyboard and mouse operations are available from this moment on:

Q key or Esc key
Quit KeyJnote immediately.
LMB (left mouse button), Page Down key, Cursor Down key, Cursor Right key or Spacebar
Go to the next page (using a transition).
RMB (right mouse button), Page Up key, Cursor Up key, Cursor Left key or Backspace key
Go to the previous page (using a transition).
F key
Toggle fullscreen mode. Unfortunately, this does not work on Windows systems.
Tab key or MMB (middle mouse button)
Zoom back to the overview page. While in overview mode, a page can be selected with the mouse and activated with the left mouse button. The right or middle mouse botton or the Tab key leave overview mode without changing the current page.
click&drag with LMB (left mouse button)
Create a new highlight box. While at least one highlight box is defined on the current page, the page itself will be shown in a darker and blurry rendition. Only the highlight boxes will be displayed in their original lightness and sharpness.
If a page with highlight boxes is left, the boxes will be saved and restored the next time this page is shown again.
RMB (right mouse button) over a highlight box
If the right mouse button is clicked while the mouse cursor is above a highlight box, the box will be removed. If the last box on a page is removed, the page will turn bright and sharp again.
S key
Save the info script associated with the current presentation. The main purpose for this is to permanently save all highlight boxes, so they will be restored the next time this presentation is started.
T key
Activate or deactivate the time display at the upper-right corner of the screen. If the timer is activated while the very first page of the presentation is shown, it activates »time tracking» mode. In this mode, a report of all pages visited with their display duration, enter and leave times will be written to standard output. This can be very useful when preparing presentations.
Return key or Enter key
Toggle spotlight mode. In this mode, the page is darkened in the same way as if highlight boxes are present, but instead of (or in addition to) the boxes, a circular “spotlight” will be shown around the mouse cursor position, following every motion of the mouse cursor.
+ key / key or mouse wheel
Adjust the spotlight radius.
Z key
Toggle zoom mode. When this key is first pressed, the current page will zoom in. The page will be displayed at double size, but in its original resolution (i.e. it will be blurry). KeyJnote will re-render the page at the new resolution if the graphics hardware supports it. During this time, KeyJnote will not accept any input, so don't even think about clicking the mouse or pressing keys before the image gets crisp again.
In zoom mode, all other functions will work as normal. Any operations that leave the current page, such as flipping the page or entering the overview screen, will leave zoom mode, too.
[ / ] key
Adjust the gamma value of the display (might not be supported on every hardware).
{ / } key
Adjust the black level of the display (might not be supported on every hardware).
\ key
Revert gamma and black level back to normal.
B key / W key
Fade to black or white, respectively. This feature can be used if a whiteboard or blackboard in front of the projection area is to be used during the presentation. Using these two keys, the screen will fade into a solid color. On any keypress or mouse click, it will fade back to normal.
click&drag with RMB (right mouse button) in zoom mode
Move the visible part of the page in zoom mode.
Cursor keys in overview mode
Navigate through pages.

Info Scripts

KeyJnote offers a powerful way to customize individual presentations using so-called info scripts. An info script is a text file having the same name and located in the same directory as the presentation file itself, except for the additional suffix .info. Thus, a presentation file called BrandNewProduct.pdf would have a info script with the name BrandNewProduct.pdf.info.

Info scripts are actually Python scripts with full access to KeyJnote's global data structures and functions. (It is possible to write real interactive applications using info scripts.) Thus, they can modify a broad range of settings concerning KeyJnote. This manual will only cover the most basic ones.

Page Properties

The main part of an info script defines the properties of each page. At the moment, three properties are defined:

title
Each page can have a title that is displayed in the KeyJnote window's title bar. If there is no title explicitly specified in the info script, the title of the page will be extracted from PDF metadata if pdftk is installed, or the image file name will be used if the presentation is an image slideshow.
transition
With this property, the transition class to be used for rendering the transition between this page and the following page can be specified. For pages lacking this property, random transitions will be chosen. A list of available transition classes can be obtained with keyjnote.py -l.
overview
This property holds a boolean value (0/False or 1/True) that specifies whether the page shall be included in the overview page. If this property isn't specified, it is assumed to be True.
skip
This boolean property can be set to 1/True if the page shall be skipped during the presentation.
Pages with overview:True, skip:False will be accessible both by cycling through the pages and using the overview page,
pages with overview:True, skip:True will be silently skipped in the normal page cycle, but remain accessible from the overview page,
pages with overview:False, skip:False will appear in the normal cycle, but not on the overview page
and pages with overview:False, skip:True will not be accessible at all.
boxes
This property stores a list of highlight box coordinates. Normally, there is no need to edit this by hand, as KeyJnote handles this automatically if the S key is pressed.
timeout
If a timeout property is present and the page is shown for the first time, KeyJnote will automatically switch to the next page after the specified number of milliseconds.
sound
Specifies the file name of a sound file to be played when the page is first entered. Playback is provided through MPlayer on UNIXish systems or the DirectShow-based gplay.exe by Karl M. Syring on Windows systems. Once started, the sound will be played until its end is reached, another sound is played, or KeyJnote is exited.

The properties are stored together in a Python dictionary called PageProps. The syntax looks like in this example:

PageProps = {
  1: {
       'title': "Title Page",
       'transition': PagePeel,
       'sound': "background_music.mp3"
     },
  2: {
       'title': "Another Page",
       'timeout': 5000
     }
}

The PageProps definition (and only the PageProps definition) will be rewritten by KeyJnote if the S key is pressed. User-defined PageProps entries will also be left untouched, except for some pretty-printing.

Global Presentation Properties

The name of the presentation is shown in the title bar of the KeyJnote window (if not in fullscreen mode). By default, the file name or (if available) PDF metadata title will be used for this purpose, but the presentation title can also be explicitly set by overwriting the DocumentTitle variable:
DocumentTitle = "My Presentation"

Another useful variable, AvailableTransitions, contains a list of all transition classes that may be used for randomly assinging transitions to pages lacking the transition property. Thus, if you want to exclude a certain transition (either because you don't like it or because you want to have it exclusively on pages where you manually assigned it using PageProps), you can write something like
AvailableTransitions.remove(PagePeel)
Alternatively, you can completely overwrite AvailableTransitions to have the same transition (or set of transitions) assigned to all pages:
AvailableTransitions=[Crossfade]

Option Overrides

Another use of info scripts is overriding the default or command-line settings on a per-file basis. This can be done by simply overwriting one of the variables that are defined at the beginning of keyjnote.py. Each of these variables corresponds either to a command-line setting, or to some constant related to visual appearance or performance. So, for example, to force fullscreen mode for a presentation, write
Fullscreen = True

Other Useful Information

Useful Third-Party Tools

Sebastian Wiesner has written a nice GUI Launcher for KeyJnote using PyQt: KeyJnoteGUI.

Rob Reid has written a Perl script that extracts transition information from special comments in LaTeX beamer source files and generates a KeyJnote info script from the gathered information: gettransitions.

License

KeyJnote is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for any particular purpose. See the GNU General Public License for more details.

Contact

You can always contact the author of KeyJnote to send him ...