=head1	NAME

png2pdf - PNG to PDF converter

=head1	SYNOPSIS

png2pdf I<options> I<inputfile> I<outputfile>

png2pdf I<options> I<directory>

=head1	DESCRIPTION

The png2pdf program converts images from the PNG file format to the
PDF file format. Different PDF levels can be choosen for output.
An alpha channel in the PNG file can be used -- depending on the
output PDF level -- to mix the PNG image against a specified
background color, to create a PDF image mask or to create a
transparency channel in the PDF file.

=head1	OPTIONS

=over	4

=item	B<-p> I<pdf-level>

chooses the PDF format level, may be either "1.2", "1.3" or "1.4".

=item	B<-n>

adds an entry to the PDF image dictionary suggesting PDF viewers
to show an interpolated image. This is useful for stretched images
(small images shown in a large screen area).

=item	B<-m> I<background-rgb>

specifies a background RGB color for mixing. This background color
is used only if the PNG file does not contain a background chunk
or  if the B<-s> option is used.

=item	B<-s>

assigns the RGB background color specified using the B<-m> option
a higher priority than the background color from the PNG background chunk.

=item	B<-i>

converts the alpha channel from the PNG file into an image mask
(if there is an alpha channel).

=item	B<-a>

converts the alpha channel from the PNG file (if present) into a
PDF transparency channel. Note: B<-a> and B<-i> can not be used
at same time.

=item	B<-l>

inverts the triggering level for image mask creation (see B<-i>).
By default only opacity=0 pixels are masked. Using B<-l> the
opacity<255 pixels are masked.

=item	B<-t>

interprets the alpha channel data as transparency (by default it
is opacity).

=item	B<-f>

activates ``make'' style behaviour (checks file modification times)
when png2pdf is run on a directory.

=item	B<-h>

prints a help text

=item	B<-v>

prints version information.

=item	B<-c> I<option>

stores permanent options.

=item	B<-u>

removes all permanent options.

=item	B<-r> ...

ignores all permanent options for this one program invokation. The
B<-r> options must be used before any other option.

=item	B<-C>

shows the permanent options.

=cut

=head1	RETURN VALUE

The program returns exit code 0 on success, positive values on error.

=head1	EXAMPLES

  png2pdf -m 255.255.255 x.png x.pdf

converts x.png to x.pdf. If there is an alpha channel in x.png this
is used to mix against either the background specified in the
background chunk (if there is one) or against the user specified
background color white.

  png2pdf -s -m 255.255.255 x.png x.pdf

converts x.png to x.pdf. If there is an alpha channel in x.png this
is used to mix against the user supplied background color (white).
The background chunk possibly contained in the PNG file is ignored.

=head1	SEE ALSO

By default a PDF manual is installed ``near'' with the binary.
If

  which png2pdf

finds the binary ``/usr/local/bin/png2pdf'', check for a file named
``/usr/local/share/doc/png2pdf/png2pdf.pdf''.

=head1	AUTHOR

Dirk Krause

=head1	COPYRIGHT AND LICENSE

Copyright (c) 2001-2005, Dirk Krause
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

=over	4

=item	* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

=item	* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

=item	* Neither the name of the Dirk Krause nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.

=back

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

=head1	LAST MODIFICATION

2005/03/22

