Since you will be creating various output formats from the same SGML source, you are going to need not only the png images, but also the pdf ones. Those need a special preparation in order to be embedded in the PDF document: we need to “add density” to them. This is one of the many reasons that the tools described in this document fail to incorporate images in PDF when ran “out-of-the-box”.
The gory details behind this are described in Section 7.2.2. Here, I will describe the most straightforward way to get working images for your PDF documents. For this purpose I have written a small utility, which I call addd (for add density). Download it, make it executable and put it somewhere like /usr/local/bin. It calls two programs which you should also have installed on your system: convert (package ImageMagick) and eps2png. You should also download the adddscr script, make it executable and put it in the images directory. The adddscr script expects a parameter, which should be one of the usual image file endings like “gif”, “png”, “jpg” etc. The idea is the following: you have all your images under the images directory and they are all of the same type, say GIF. Then you just call
adddscr gif |
The adddscr script will convert all GIFs in the current directory to PNG format, then call the addd utility to add the right density to each image. Since addd produces .pdf and .eps from a given .png image and adddscr produces an additional .bmp, you end up with all the required image formats with the right properties for the subsequent inclusion in the various documents, be it PS, PDF or RTF. You may then delete your GIFs, you will not need them anymore (see Burn All GIFs.
If your images are all of type JPG, just call
adddscr jpg |
in the images directory. If you just produced a sole image, you must call addd manually and then convert the png file to bmp. Example: Suppose you have just produced an image in JPG format, say myimage.jpg. Then do:
convert myimage.jpg myimage.png addd myimage convert myimage.png myimage.bmp |
![]() |
Caution |
|---|---|
|
You will need to repeat the above steps for each and every image you produce! If you omit it, or use your own .pdf and .eps versions, most probably they will FAIL to be embedded in your PDF, resp. PS document! |
| Last updated Mon Sep 24 01:19:25 CEST 2007 | Permalink: http://www.karakas-online.de/mySGML/add-density.html | All contents © 2002-2007 Chris Karakas |