[texhax] help

Reinhard Kotucha reinhard.kotucha at web.de
Tue Nov 20 00:21:31 CET 2018

On 2018-11-19 at 11:41:23 +0000, Peter Flynn wrote:

 > On 19/11/2018 11:09, Philip Taylor wrote:

 > > Why not PDF ?  Since Prasad is using XeLaTeX, and since XeTeX
 > > provides \XeTeXpdffile, conversion to PDF would seem a definite
 > > option to me.
 > I am under the impression (perhaps mistaken) that TIFF is a bitmap
 > format, so PNG would seem to be more appropriate than PDF.

Dear Phil and Peter,
though it sounds curious, you are both right.

It makes a lot of sense to convert bitmap graphics to PDF.  TeX Live
provides a program (Windows only) called sam2p, written by Péter
Szabó, which converts bitmaps to EPS or PDF.

This program is very fast, creates very small files, supports many
bitmap formats, and is easy to use:

  sam2p foo.tif foo.pdf

For details see:  https://pts.50.hu/sam2p/

As far as TeX is concerned, converting bitmap graphics to PDF in
advance is advantageous.

The PDF standard doesn't support either TIFF nor PNG.  pdftex, luatex,
and xetex are using the libpng library in order to de-compress PNG
files and convert them to PDF's native bitmap format.  All this is
done at runtime e.g., each time you compile your TeX document.

If you convert PNG files to PDF in advance, TeX includes them without
further processing.  This is much faster and can save you a lot of
time, especially if there are many such files.

It's a pity that almost nobody is aware of sam2p.

BTW, TeX Live provides sam2p only for Windows.  This is on purpose.
Linux distributors prefer to provide it as a separate package because
it's also useful to people who are not using TeX.


Reinhard Kotucha                            Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                    mailto:reinhard.kotucha at web.de

More information about the texhax mailing list