Content-type: text/html Manpage of ipdf

ipdf

Section: User Commands (1)
Updated: 13 Aug 2001
Index Return to Main Contents
 

NAME

ipdf - Creates indexed pdf documents from text files

 

SYNOPSIS

ipdf [-hDiobdTLlcfFm] [file]

 

DESCRIPTION

Creates pdf documents from text files. When called without arguments, the contents of STDIN are converted to PDF and printed on STDOUT. ipdf was created to help facilitate creating a paperless office while still supporting a legacy machine that might generate plain-text reports by allowing an easy and flexible way to convert the text document in to a document that preserves formatting and is indexed/searchable easily.

There are many options, and most can be set to defaults in either /etc/ipdf.conf or ~/.ipdf.conf:


 -h
        Print help and exit


 -D LEVEL
        Enable debugging.  Only effective if --enable-debug was used
        during compilation.


 -i LINE:START:STOP:SUPPRESS:REPARENT
        Creates an index using LINE from characters START to STOP.  If
        SUPPRESS is 0, then suppressing multiple spaces in the index will
        be disabled. If REPARENT is set to 1, then this bookmark will
        be made a top-level bookmark instead of a child of the previous -i
        definition. It will default to false, unless when compiled using the
        --default-reparent=1 flag to configure. Creating an index adds
        named bookmarks to the PDF document as a collapsable tree.
        Some readers, such as Adobe Acrobat, will display those
        bookmarks so the user can jump to parts of the document. Multiple
        indexes may be specified with multiple -i options. See INDEXING
        for examples of how this works.


 -I PAGE:LINE:START:STOP:SUPPRESS:REPARENT
        Creates an absolute index on page PAGE on line LINE from characters
        START to STOP. SUPPRESS and REPARENT work the same as for -i,
        except REPARENT is always 1. See INDEXING for more information.


 -o FILENAME         Output filename, instead of STDOUT


 -b FILENAME
        File to use as background image, i.e. for imposing text over a
        pre-printed from.


 -d DPI
        The DPI of the background image.  The default is 72DPI.


 -T NUM
        Set top margin


 -L NUM
        Set left margin


 -l LINES
        Maximum number of lines per page, if no form feed ( character
        is seen before the line count reaches this, then a form feed is
        forced. Some older systems would simply generate reports based
        on a pre-defined form length instead of using form feed characters.
        Use this option to handle those kinds of systems.


 -c CHARS
        Number of characters per line.  Depending on landscape/portrait/
        green bar/laser/daisywheel etc types of paper and printers, there
        may be different numbers of characters per line for those kinds of
        documents.


 -m[letter-p|letter-l]
        Page mode, letter-p is portrait US letter 8.5x11in, and letter-l is
        landscape mode. Currently no other page modes are supported.


 -f SIZE
        Font size.  May be a decimal, i.e 7.5.


 -F FACE
        Font face name, valid values are:

        Courier
        Courier-Bold
        Courier-Oblique
        Courier-BoldOblique
        Helvetica
        Helvetica-Bold
        Helvetica-Oblique
        Helvetica-BoldOblique
        Times-Roman
        Times-Bold
        Times-Italic
        Times-BoldItalic
        Symbol
        ZapfDingbats

        For reports Courier or Courier-Bold are best because they are fixed-
        width fonts and will preserve the formatting on old reports.

 

INDEXING

Currently 2 indexing methods are supported, absolute page/line indexing, and relative line-based indexing. You should usually use 1 or the other, mixing absolute and relative indexing may not always work right.

 

RELATIVE INDEXING

Most text-based reporting systems use the running-header approach. For example, a system that prints a customer listing might create a header that contains the customer number, territory, and salesman name. For example sake, let's say it looks a little like this:

Page 1 CUSTOMER LIST DATE Salesman: 004 Mr Salesman 00100 Mr Customer
 ...

If this is a standard header, and it's on every page, you might want an index based on the saleman and customer number. But you don't want to see the same salesman name repeated over and over again in the index, you just need the first occurance. That's what the relative indexing does, it creates a bookmark in the file whenever the value according to the index spec changes, so you can, say, jump to the beginning of the section for Mr Salesman here.

Now say each salesman has customers assigned to them, and this report is sorted by salesman then by customer. A convenient index would look like this:

004 Mr Salesman
  + 00100 Mr Customer
  + 00101 Another

005 Another Salesman
 ...

So you could click Mr Salesman and go to the beginning of Mr Salesman's section in the report, and you also see all the customers under the salesman in a little tree. Clicking the customer name/number would then take you to the page for that actual customer.

With ipdf, you want to be able to index the second and third lines of the report. You could do that with a command like:


 ipdf -o report.pdf -i 1:11:20 -i 3 report.txt

And it would create report.pdf from report.txt. Notice that 1 of the -i args has more : options in it, any options you don't fill in will get the default. The only option required, is the line number, but in the first -i I chose to use only characters 11-20 because I wanted to get rid of the word "Salesman" at the beginning of the line.

 

ABSOLUTE INDEXING

Sometimes there are reports that are always N pages long, maybe a summary by division report. For example, if you had 3 sales divisions, say inside, outside, and industrial sales, and you have a report, "Sales by Division Summary" and it's always 3 pages long. Furthermore, the name of the division for the page is on line #2. To make an index for each of the divisions, on page 1, 2, and 3, you could use absolute indexing like this:


 ipdf -o report.pdf -I 1:2 -I 2:2 -I 3:2 report.txt

And you would have indexes created for page 1 line 2, page 2 line 2, and page 3 line 2.

 

CONFIG FILES

Configuration files can reside in both /etc/ipdf.conf and ~/.ipdfrc. They can be used to set global defaults, since usally most reports from a system are formatted mostly the same. That means that most likely, 90% or more of the time you will want the same font/page/margins.

The precedence of options goes:

internal defaults -> ipdf.conf -> .ipdf.con -> command line options

The format of the options file is:

directive <space> value

With the command line options overriding any defaults. The configuration files can contain the following directives:


 debug          Same as -D

 chars_per_line Same as -c

 lines_per_page Same as -l

 top_margin     Same as -T

 left_margin    Same as -L

 font_size      Same as -f

 font_face      Same as -F

 page_mode      Same as -m

For a sample, see the ipdf.conf.dist that comes with the distribution.

 

BUGS

A little sensitive to the order of options on the command line.

 

THANKS

James Tait <JTait@wyrddreams.demon.co.uk>

Help with bugfixes, features, and building on Solaris

 

AUTHOR

Steve Slaven <bpk@hoopajoo.net>

 

SEE ALSO


 

Index

NAME
SYNOPSIS
DESCRIPTION
INDEXING
RELATIVE INDEXING
ABSOLUTE INDEXING
CONFIG FILES
BUGS
THANKS
AUTHOR
SEE ALSO

This document was created by man2html, using the manual pages.
Time: GMT, August 14, 2001