diff --git a/rem2pdf/bin/rem2pdf.in b/rem2pdf/bin/rem2pdf.in index dfb24c71..ee177ef8 100644 --- a/rem2pdf/bin/rem2pdf.in +++ b/rem2pdf/bin/rem2pdf.in @@ -76,12 +76,12 @@ Options: --landscape, -l Print in landscape orientation --small-calendars=N Choose location for small calendars --c=N Synonym for --small-calendars=N +-cN Synonym for --small-calendars=N --left-numbers, -x Print day numbers on the left --fill-page, -e Fill the entire page ---media=MEDIA, -m=MEDIA Size for specified media ---width=W, -w=W Specify media width in 1/72nds of an inch ---height=H, -h=H Specify media height in 1/72nds of an inch +--media=MEDIA, -mMEDIA Size for specified media +--width=W, -wW Specify media width in 1/72nds of an inch +--height=H, -hH Specify media height in 1/72nds of an inch --title-font=FONT Specify font for calendar title --header-font=FONT Specify font for weekday names --daynum-font=FONT Specify font for day numbers @@ -101,6 +101,8 @@ Options: EOF } +Getopt::Long::Configure('bundling_values'); + my $ret = GetOptions('landscape|l' => \$settings->{landscape}, 'small-calendars|c=i' => \$settings->{small_calendars}, 'left-numbers|x' => \$settings->{numbers_on_left}, @@ -270,8 +272,13 @@ rem2pdf - draw a PDF calendar from Remind output =head1 DESCRIPTION B reads the standard input, which should be the results of -running B with the B<-pp> option. It emits PDF code that draws -a calendar to standard output. +running B with the B<-p>, B<-pp> or B<-ppp> options. It emits +PDF code that draws a calendar to standard output. + +B uses the Pango text formatting library (L) +and the Cairo graphics library (L) to produce +its output. The CPAN modules Pango (L) +and Cairo (L) are prerequisites. =head1 OPTIONS @@ -282,7 +289,7 @@ a calendar to standard output. Print the calendar in landscape orientation. Essentially, this swaps the width and height of the output media. -=item --small-calendars=I, -c=I +=item --small-calendars=I, -cI Control the inclusion of small calendars for the previous and next month. Possible values for I are: @@ -322,7 +329,7 @@ the default top-right. Make the calendar fill the available space on the page. -=item --media=I, -m=I +=item --media=I, -mI Specify the paper size (Letter, A4, etc.) For a list of valid media sizes, run: @@ -331,7 +338,7 @@ run: The default media size will be marked with an asterisk. -=item --width=I, -w=I, --height=I, -h=I +=item --width=I, -wI, --height=I, -hI Rather than specifying a named media size, directly specify the width and height of the output in 1/72ths of an inch. You must specify both @@ -414,6 +421,65 @@ The default is 36. =back +=head1 USAGE + +To use B, pipe the output of B with one of the +B<-p>, B<-pp> or B<-ppp> options into B. The PDF output +will be sent to standard output. So for example, to print a 12-month +calendar for the year 2030, use: + + remind -pp12 /dev/null Jan 2030 | rem2pdf -e -l -c=3 | lpr + +You can concatenate multiple B runs. For example, the following +will produce a PDF calendar for January through March of 2023, and +June of 2023 (for a total of four pages); + + (remind -pp3 Jan 2023 /dev/null ; \ + remind -p June 2023 /dev/null) | rem2pdf -e -l -c=3 > cal.pdf + +=head1 FORMATTED TEXT + +B supports a B reminder type called B. This +lets you format text using the Pango markup language, described at +L. Here are some +examples: + + REM Mon SPECIAL PANGO Bold and italic + REM Tue SPECIAL PANGO Fancy + REM Wed SPECIAL PANGO Bold red + +Other back-ends such as B and B will ignore PANGO +special reminders. + +=head1 ABSOLUTELY-POSITIONED TEXT + +If your B special reminder starts with C<@I,I> where I +and I are floating-point numbers, then the Pango marked-up test is +positioned absolutely with respect to the day's box (and is not +counted when calculating the box's height.) + +A positive I value positions the left edge of the text I points +to the right of the left side of the calender box, while a negative +I value positions the right edge of the text I points to the left +of the right side of the calender box. + +A positive I value positions the top edge of the text I points +below the top of the calender box, while a negative I value +positions the bottom edge of the text I points above the bottom of +the calender box. + +If you use absolutely-positioned text, it's up to you to make sure it +doesn't overlap other text; B takes no special precautions to +prevent this. + +As an example, this places Sunrise and Sunset times at the bottom left +of each calendar box: + + REM SPECIAL PANGO @1,-1 Rise [sunrise($U)] Set [sunset($U)] + +(Note that Pango expresses font sizes in 1024's of a point, so a size of +4800 works out to about 4.6 points.) + =head1 AUTHOR B was written by Dianne Skoll