Skip to content


Subversion checkout URL

You can clone with
Download ZIP
C C++ Objective-C Shell
Pull request Compare This branch is 64 commits ahead, 30 commits behind master.
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Project information

This is a fork of Xournal, the inking / PDF markup application written by Denis Aroux. It is based on D. M. German’s github branch and builds on Xournal 0.4.5, adding several features. These include image pasting and embedding, lasso selection tool, and autosave. Xournal provides subpixel resolution, PDF annotation and export, and runs on both Linux and Windows.

This branch uses patched 64-bit font tool components. When building on a 32-bit system, remove this patch via patch -p1 -R < xournal-64bit.patch

Installation: see INSTALL or INSTALL.win32

User’s manual: see html-doc/manual.html

Original project page:


  • master: the main branch with my code and many extra features
  • upstream: original code maintained on Sourceforge
  • debian: ubuntu xournal packages

The latter two branches are inherited from dmgerman’s repository.

Changes by Leo Alekseyev:

New features

  • resize selection improvements:
    • fixed aspect ratio when resizing selection by dragging corner
    • larger margin for grabbing a corner handle
    • (cosmetic) added small selection box padding
  • pressing stylus button-2 and dragging duplicates selection
  • autosave patch ported to Windows (see below)
  • image support (combination of my code and Simon Guest’s code; see below)

Patches applied

Autosave (Timo Kluck)
Part of enhance image (Simon Guest)
Lasso (Ian-Woo Kim)

Image functionality

Images can be pasted from the clipboard; image copy/paste works between Xournal instances. Images are embedded inside the XOJ files with Base64 encoding. They are currently stored at the original resolution, and are resized as needed for display.

The code is a combination of contributions by Leo Alekseyev and Simon Guest (in particular SG’s code handles PDF export of images). Overall functionality is very close to that of SG’s enhanced image patch on Sourceforge, with the major difference that the images are appropriately rescaled as the zoom level changes.

The code builds on the original insert image patch by Victor Saase


Original patch is Timo Kluck’s modification of code from Edward Z. Yang and Paulo Neves. The following changes were made to Timo Kluck’s version:

  • code made compatible with Leo Alekseyev’s and D. M. German’s current codebase
  • autosaves are stored in the central location (default: ~/.xournal/autosaves/ and ~/.xournal/autosaves_tmp/ for files that have not been saved). The current path of the file is encoded as a SHA1 hash appended to the file name.
  • checking for possible autosaves is done on opening a file, not just program startup
  • autosave now works on Windows (PIDs are obtained from Windows process API (psapi.dll)).


Original patch is due to Ian-Woo Kim. As written, it triggers a bug in libgnomecanvas 2.30 that results in an invalid path and a subsequent segfault due to poor error handling in libgnomecanvas. A fixed version of gnome_canvas_path_def_close_all function is included here.

Some of the code was refactored to avoid code duplication between rectangle and lasso selection.

Code reorganization

  • Separated out image, selection, and clipboard functionality into their own files (xo-image.c, xo-selection.c, xo-clipboard.c).
  • Put include guards into all headers.
  • Refactored much of the clipboard copy/paste code.
  • Refactored rectangle selection code to maximize code reuse between lasso and rectangle selection functions.

Build system

  • Modified automake files to enable seamless compilation under Windows (code was taken from Georg Wechslberger’s branch at
  • Added Windows installation instructions (Georg Wechslberger’s modifications of Dirk Gerrits’ instructions with some modifications by L.A.).
  • Added 64-bit patch to the repository (originally found in the Xournal SUSE package). This patch only deals with the included Sun font tools (that code is not 64-bit safe).

Patches from other sources

Patches applied by D. M. German:


My branch of xournal

This is my branch of xournal. It contains several additions to it. They are mainly intended for people who use a tablet, and regularly annotate pdfs.

Summary of features

FeatureBrief Description
Auto save pdfEvery time the xoj file is saved, a pdf is exported
Command line optionsSeveral options:
jump to page–page=N
export to pdf without starting GUI –pdf
start in fullscreen mode –fullscreen
Hide the interface (except menu) –no-interface
Hide the interface in full screen mode –no-interface-fullscreen
Hide InterfaceHide the interface in normal and fullscreen mode
Add empty pages to pdfWhen the background is a PDF, the new pages will be blank, using default paper
Use SPACE to scrollSPACE bar can be used to scroll the document
Text font sizingUse ctrl >/</B to change the font of the text being edited
Last page seenJump to the last page seen (info stored in the .xoj file)
Next-prev fileQuickly go from one file to the next/prev in the current directory
Poor man’s bookmarksJump quickly to the previous/next annotation
Partial searchSearch: finds occurrence, but no UI (see branch search for full features)
Config file optionsPaper related options
- ruling_color: color of lines of graph and ruled paper (RGBA)
- ruling_graph_spacing: size of squares in graph paper (in picas)
- ruling_margin_color: left margin in ruled paper (in picas)
- ruling_ruling_lined_spacing: spacing of lines in ruled paper (in picas)
- ruling_top_margin, ruling_bottom_margin, ruling_left_margin: margins for ruled paper (in picas)
- ruling_thickness: thickness of lines in graph and ruled paper
new_background_from_pdf: create new pages from current background
show_interface_fullscreen: do we show the interface in full screen mode?
show_interface: do we show the interface by default?
touch_screen_as_hand_tool: in tablets that support it, use touch screen as a hand tool and stylus for writing
autoexport_pdf: auto export a PDF every time a file is saved
pdf_viewer: command line for external pdf viewer

Features Implemented

See patches aplied below

Autosave to PDF

Any time that a .XOJ file is saved, a PDF is exported. This is controlled by an option: “Auto export PDF”

Enable/disable interface menus in full screen mode and default mode

I have added the ability to remove the interface in normal mode and full screen. In fullscreen no interface is shown. In normal mode the menubar is shown (you can remove it too, using the .config file, but that is sort of undocumented feature).

There are now two config options that control it:



Remember, in fullscreen mode you can always exit it with F11.

I have also added a command line option to start xournal in fullscreen mode, and with or without interface in either mode.

–no-interface Do not show interface –no-interface-fullscreen Do not show interface in fullscreen –fullscreen Run xournal in full screen mode

The contents of the interface and their order is controlled by the config variables:

interface_order=menu main_toolbar pen_toolbar drawarea statusbar

interface_fullscreen=main_toolbar pen_toolbar drawarea

Add empty pages to pdf

In the original xournal, during annotation of a PDF, a new page will duplicate the current page. With this patch the new page is empty.

This should be an option, not hardcoded, just in case somebody really wants to do it.

Use SPACE bar to scroll document

Scroll the document using SPACE bar, as if it was page down.

Config file options

There are various new config file options. See above.

Patches applied:

Last page seen
Add next-prev file
Cmd Line: Open a given page
Text font sizing
Poor man’s bookmarks

Load last page seen

Saves the current page number in the xoj file. When you open it again, jumps there

Add next-prev file

Opens the next/pref .xoj file in the current directory

Text font sizing

Use Ctrl-B to bold, Ctrl > and Ctr < to increase size or reduce size of annotation

Poor man’s bookmarks

Jumps to “next notable” page, e.g. a page that has inking on it. This is mostly useful when working with marked-up PDF documents, which might not have inking on every page.

Image insert

Basic image support from Victor Saase

Patches I’d like to apply

ortho and snap
Preserve aspect ratio when resizing
Insert images
Check this out
Multi-page view and Lasso


The following are current branches with different experimental features:

  • master: the main branch with my code and many extra features (should be stable)
  • upstream: denis code, reflecting his CVS repository
  • debian: ubuntu xournal packages
  • search: implements search, basically completed (needs testing)
  • bookmarks: implements basic bookmarks (needs work)
  • leo: implements improved image handling (needs testing, needs to be rebased)
  • multipage: implements dual page view (buggy, needs work)
Something went wrong with that request. Please try again.