bmeps - Converter from PNG/JPEG/NetPBM to EPS and PDF bmeps [I<options>] [I<inputfile> [I<outputfile>]] bmeps [I<options>] I<directory> bmeps -c -lI<name> bmeps -u bmeps -C bmeps -h bmeps -v Bmeps reads the specified input file, converts it and write output to the specified file. If no output file name is specified bmeps writes to standard output. If no input file name is specified bmeps reads from standard input. If bmeps is run on a directory it searches the directory for files it can handle. A conversion is done for each file found, except when running in make mode. In make mode bmeps checks for a conversion output file, a conversion is run only if the output file does not yet exist or is not up to date. shows a help text. shows version number and license conditions. saves the configuration name as default configuration. If no configuration is specified on a command line, bmeps uses either the default configuration or the configuration specified in the EPSOUTPUT environment variable. The environment variable has higher priority. shows the current configuration, can be used to view the permanent settings. removes the permanent settings (default configuration, make mode setting). ignores the permanent settings for one program invokation. chooses a configuration. Configuration entry overrides can be appended, separated by comma. overrides one configuration entry. chooses the frames to convert. By default bmeps converts all frames found in the input file. chooses the type of input data (when running as a pipe). chooses the output file name (if missing) automatically based on the input file name. suppresses the notification about alpha channels transferred from PNG or TIFF to PDF. enables the notification about alpha channels transferred from PNT or TIFF to PDF. -m- activates/deactivates make mode. On success bmeps returns exit code 0. Positive values are returned on errors. Error messages and diagnostic messages are printed to the standard output stream and the error output stream.

Configuration file syntax
The configuration file consists of a list of sections, each section defines one configuration. The section is started by the configuration name in square brackets. The name of a ``parent'' configuration to inherit from can be specified using a colon as separator. The remaining lines of a section are key/value pairs to set the configuration entries. An example to set up a configuration named ``simple_configuration'' might look like: [simple_configuration:eps2] color = no encoding = ascii85:run-length

Configuration entries
Each configuration entry has a name assigned. I recommend to write the full name in configuration files. The abbreviations should only be used when typing commands on the command line. The list below shows both full names and abbreviations. o.t=string the output type, either ``ps'', ``pdf'' or ``bb'' (for LaTeX bounding boxes). l=string the output level, either ``1'', ``2'' or ``3'' for EPS or ``1.2'', ``1.3'' or ``1.4'' for PDF. c=boolen color mode (output is grayscaled if color mode is deactivated). dsc.c=boolean dsc mode, DSC comments are written to PS/EPS output if dsc mode is enabled. e=list list of allowed encoding and compression mechanisms. Items in the list are separated by colon, abbreviations can be used, i.e. ``a:r:d'' instead of ``ascii85:run-length:dct''. The following encodings can be used: ASCII85-Encoding. If ASCII85-encoding is disabled bmeps uses ASCII-Hex-encoding. run-length encoding. flate compression (from zlib). DCT encoding. Bmeps does not DCT-encode data itself, it lets DCT-encoded data from JPEG files pass through if some tests on the JPEG file were successfully. Note: The usable compression and encoding mechanisms depend on the PS level. m=boolean background color mixing. If the input image contains an alpha channel the foreground color specified for the pixel is mixed against the background color. Alpha data is used as foreground opacity. b=rgb-triple default background color. This color is used as background color if the input image does not contain background color information. a.u.d.b=boolean flag, ignores the background color information from input file, the default background is always used. c.i.m=boolean flag, uses input alpha channel to create an image mask. i.m.t.l=numeric the trigger level to convert alpha data to image mask. Must be in the range [0;1]. t.a.c=boolean flag, transfers alpha data from input to output. This is only possible when creating PDF-1.4 output. Alpha data transfer deactivates mixing and image mask creation. i=boolean image interpolation flag in output. j.i=boolean enables interpolation also when passing-through DCT encoded data from JPEG files. u.r.c=boolean uses image resolution data from input to resize output. m.s=media the paper size to fit the image: p.f=pdf-zoom initial view, ``width'', ``height'' or ``page''. d=boolean draft mode, draw a placeholder rectangle only. sh=boolean activates/deactivates showpage operator in output. o.d=boolean use dictionary argument for image operator or multiple plain arguments. s.d=boolean creates a separated dictionary for definitions in the bmeps output. This preserves existing dicionary entries from the enclosing document from being overwritten accidently. v=boolean writes ``1 vmreclaim'' to output to suggest a garbage collection. j.s.s=list specifies the allowed SOF_n markers in DCT encoded data, i.e. ``0:1'' to allow SOF_0 and SOF_1.

Configuration example
[copy_of_ps2] output type = ps level = 2 interpolate = yes color = yes multiple data sources = yes dsc comments = yes encoding = ascii85:run-length:dct mix = yes background = 1.0:1.0:1.0 always use default background = yes create image mask = no image mask trigger level = 0.000001 transfer alpha channel = no showpage = no operator dictionary = yes separated dictionary = yes vmreclaim = no draft = no jfif sof set = 0:1 jpeg interpolate = no use resolution chunk = no # No media size specified -> 1 pixel = 1 PS point # media size # No PDF zoom factor, we create PS output # pdf fit bmeps -c -leps2,color=no bmeps input.png output.eps bmeps -lpdf input.png output.pdf bmeps . bmeps -lbb . bmeps -lfaxpdf input.tiff output.pdf Only TIFF files which can be read using the TIFFReadRGBAImage() function from the libtiff library can be used. A self-made analysis function is used to test whether or not a JPEG file can be used directly as DCT encoded data. If this function fails the JPEG image is decoded using the jpeglib library, output is encoded using run-length, flate and ASCII85/ASCII-Hex encoding. PDF documentation is installed near the binary. If which bmeps shows ``/usr/local/bin/bmeps'' check the ``/usr/local/share/doc/bmeps'' directory. The project homepage http://bmeps.sourceforge.net/ also provides documentation. Dirk Krause Copyright (c) 2001-2006, 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: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * 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. * Neither the name of the Dirk Krause nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. 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. 2006-11-25