· Change language (Currently: English)

Creating Wall Calendars with PCAL

January 19, 2014 00:00 -0500

PCAL is a console application that allows you to generate wall calendars or organizers in PostScript and HTML formats. PostScript files can be viewed in any PDF reader. HTML files can be viewed in any Web browser. The exported calendars are ready for printing.

This article will show you how to use PCAL to:

Installing PCAL

In gNewSense open a terminal by going to Applications → Accesories → Root Terminal and run the following command:

# apt-get install pcal

You can close the Root Terminal after installation, we will use a regular Terminal in the following sections.

Generate a one-page calendar

One-page 2014 calendar

Figure 1. One-page 2014 calendar.

Open a terminal by going to Applications → Accesories → Terminal and run the following command:

$ pcal -w -o calendar.ps 2014

The command above means:

  • pcal: the name of the application.
  • -w: indicates that all the months of the year will appear in the same page.
  • -o calendar.ps: indicates the name of the generated file (.ps is the extension used for PostScript files).
  • 2014: indicates the year of the calendar. If you ommit it, pcal will print the calendar of the current year.

Generate a multi-page calendar

First page of a multi-page calendar, January 2014

Figure 2. First page of a multi-page calendar, January 2014.

Open a Terminal and run the following command:

$ pcal -P letter -l -o calendar.ps 1 2014 12

Where:

  • -P letter: indicates that the size of the generated document is "letter".
  • -l: indicates that the document will have "landscape" orientation.
  • 1: indicates the first month in the resulting calendar (January, in this case).
  • 12: indicates that the calendar will have twelve months, starting from the month indicated above. In this case, all months of the year will be printed.

Generate a multi-page calendar with events

July 2014 with daily events

Figure 3. July 2014 with daily events.

PCAL can read date files or configuration files where you can specify the calendar formatting and events that will occur during the year. Configuration files are plain text files.

PCAL comes with a sample configuration file that can be found in the file system in /usr/share/doc/pcal/examples/pcal-cfg.txt.gz. But see the example below to make yourself an idea of how these files work.

Note

Keep character encoding in mind.

When saving a configuration file that contains non-Latin characters, select "Western (ISO-8859-15)" in the "Character Encoding" field that appears in the "Save as…" dialog of the text editor you're using. This way, calendars generated in languages different to English will display correctly. Using this encoding is necessary because PCAL doesn’t have support for UTF-8 yet, unlike most modern software (see "PCAL Shortcommings" in PCAL’s website).

gedit's Save as… dialog

Figure 4. gedit's Save as… dialog.

Suppose you want to generate a 2014 workout calendar for your friend and it should have the following characteristics:

  • Printable in letter format with landscape orientation.
  • The text displays in Spanish.
  • Every day there will be an event: cardio workout.
  • Mondays, Wednesdays and Fridays, another event: strenght workout.
  • January 31st: a date with a dietitian.

You can write it as follows:

# ---------------------------------------------------------------------------
# Workout Calendar
# ---------------------------------------------------------------------------

#
# FORMATTING OPTIONS
#

# Paper size
opt -P letter

# Paper orientation
opt -l

# Text language
opt -a es

# First day of the week
opt -F Monday

# Font type
opt -d Times-Roman/18 -t Times-Roman/30 -n Times-Roman/10

#
# EVENTS
#

# Cardio routine
all days       in all    Cardio

# Strength routine
all Mondays    in all    Fuerza
all Wednesdays in all    Fuerza
all Fridays    in all    Fuerza

# Dates
Jan 31 Dietista

Now run the following command in a Terminal replacing the text in capitals with the name you gave to your configuration file and the name you want for the resulting calendar:

$ pcal -f CONFIGURATION_FILE_NAME -o CALENDAR.ps 1 2014 12

Remember that you can learn more about PCAL by reading its manual (you can close the manual pressing the Q key):

$ man pcal

If you know an easier, more flexible way to generate calendars, please let me know in the comments ;)

Related topics: