NAME

a2pdf - converts ASCII text to PDF format, with optional line/page numbering and Perl syntax highlighting

SYNOPSIS

a2pdf [options] [filename]

Options

a2pdf recognises the following command line options:

--help

Displays usage message and exits.

--doc

Displays full documentation and exits.

--version

Prints the version number and exits

--output-file | -o

Specifies the filename for the PDF file. If this option is not set, a2pdf will output to STDOUT.

--header | --noheader | --title | --notitle

Prints the name and modification timestamp of the input file at the top of each page. If input is taken from STDIN, then the current date and time is printed. This option is enabled by default, use --notitle or --noheader to disable.

Adds the current page number to the bottom of each page. This is enabled by default, use --nofooter or --nopage-numbers to disable.

--line-numbers | --noline-numbers

By default, line numbers will be included in the output PDF file. To disable this behaviour, use the --noline-numbers option.

--perl-syntax | --noperl-syntax

Enables or disables (default is enabled) Perl syntax highlighting. This feature requires that the Perl::Tidy module is installed.

--page-width
--page-height

Page width and height in points. Default page size is 595 x 842 (A4).

--margins
--left-margin
--right-margin
--top-margin
--bottom-margin

Specifies the non-printable area of the page. The --margin option will set all margins to the same value, however individual margins may be altered with the appropriate options. Values must be given in points. The default value for all margins is 48 points (0.75").

--font-face

Sets the font to use for the PDF file - currently this must be one of the PDF core fonts. The default font face is Courier.

--font-size

Font size in points, default value is 10.

--line-spacing

Line spacing in points, default value is the font size + 2.

Options may be given in any format recognised by the Getopt::Long Perl module, e.g. --name=value or --name value. Option names may be abbreviated to their shortest unique value.

If the input filename is not given, then a2pdf will expect to receive input from STDIN.

DEPENDENCIES

a2pdf requires the PDF::API2 Perl module (tested with PDF::API2 version 0.3r77).

Perl syntax highlighting requires the Perl::Tidy module (tested with Perl::Tidy version 20031021)

BUGS / ISSUES

  • If the Perl syntax highlighting feature is used and the input Perl code uses source filter modules, then depending on the changes made by the source filter the syntax highlighting may not be performed correctly.

    A workaround for this is to use the Filter::ExtractSource module which captures Perl code after the source filtering has been processed during compilation. This can be run in a pipeline with a2pdf as follows:

    perl -c -MFilter::ExtractSource input.pl | a2pdf >output.pdf
  • When running under Red Hat 9, the LANG environment variable must be set to 'C'.

SEE ALSO

a2pdf homepage - http://perl.jonallen.info/projects/a2pdf

PDF::API2 - http://search.cpan.org/dist/PDF-API2

Perl::Tidy - http://search.cpan.org/dist/Perl-Tidy

Filter::ExtractSource - http://search.cpan.org/dist/Filter-ExtractSource

AUTHOR

Written by Jon Allen (JJ), <jj@jonallen.info> / http://perl.jonallen.info

COPYRIGHT and LICENCE

Copyright (C) 2004 Jon Allen (JJ)

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.