a2pdf

Download

Description

Command-line utility to convert ASCII text to PDF format, with optional line/page numbering and Perl syntax highlighting.

Usage

a2pdf [options] input.txt >output.pdf

Options

a2pdf accepts the following command-line options:

  • --help
    Prints usage details and exits.
  • --doc
    Displays full documentation and exits.
  • --version
    Prints version number and exits.
  • --title
    Sets the title to be included in the page header. If unspecified, the title will default to the name of the file which is being converted, or to 'STDIN' if a2pdf is processing from standard input.
  • --timestamp
    Boolean option - if set, the timestamp of the file to be converted will be included in the page header. This option is turned off by default.
  • --icon
    Path to an image file which will be included as part of the header in the top left of each page. Image files may be in any format supported by PDF::API2.
  • --icon-scale
    Scaling value for icon images, default is 0.25.
  • --header | --noheader | --notitle
    Prints a header consististing of the page title, and optionally the timestamp and an image icon at the top of each page. This option is enabled by default, use "--notitle" or "--noheader" to disable.
  • --footer | --nofooter | --page-numbers | --nopage_numbers
    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-height
    Page height in points. Default is 842 (A4).
  • --page-width
    Page with in points. Default is 595 (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.
  • --noformfeed
    By default, any formfeed characters in the input stream will be processed and will act as expected, i.e. a new page will be started in the output PDF file. This can be disabled with the "--noformfeed" option which will cause all formfeed characters to be ignored.
About

Jon Allen - freelance Perl & Catalyst developer, web designer, and technical manager.

Available for contract work and consultancy.

Contact jj@jonallen.info.

Follow me on Twitter at twitter.com/pennysarcade.