Quantcast
Channel: Heap Dump » Structured Content
Viewing all articles
Browse latest Browse all 10

Image problems with DITA

$
0
0

While working with DITA yet more image issues arise! This time it’s to do with how bitmapped images are rendered in PDF output. What seems to be the issue here is large images are appearing outside the boundary of the PDF.

We’ve played around with various possible methods to solve this, but each one seems to bring more burdens! We’ve tried setting a scale attribute to images, which while it works nicely in PDF, but outputs tiny images for HTML. Setting a scalefit attribute to yes, didn’t seem to help at all, and images still rendered outside the viewable area. Even editing the fo xsl files to set scale-down-to-fit caused issues which image scaling (small images started stretching out). One feasible solution was to set the width of every image to a size which would fit in the PDF nicely, although this works for several images, it’s extremely cumbersome once you start having large volumes of them!

I finally came stumbled upon the discovery that the FO processor was not finding a PPI for each image, and defaulting it to 90, which then causes these bizarre problems!
The fix for this was then to set the PPI of each image to 120, this can be done in any image processing software, but to cut out doing this  for each individually, ImageMagick was used, a nice free image processing tool which had the ability to process images in batch via the console!

ImageMagick is easily installed on MAC OS via MacPorts.
MacPorts will custom build ImageMagick in to your environment using the follow command line argument

 $ sudo port install ImageMagick

After installation, navigate to your image directory via the console and run the ‘mogrify’ command of the ImageMagick toolset to change the DPI of the images in that directory.

    $ sudo mogrify -units PixelsPerInch -density 120 *.png *.jpg

The example shows two image types at the end, but you can add as many as necessary, it may only be one!

The post Image problems with DITA appeared first on Heap Dump.


Viewing all articles
Browse latest Browse all 10

Trending Articles