views:

97

answers:

1

is there a way to specify the maximum width of images in a docbook xsl-transform?

we have a problem with screen shots being to big to fit on a page, and thus would like to set a max width on images in the output.

specifying the width of the image in the Docbook XML files seems bad form (the Docbook file should be about content not presentation), a lot of manual work, and likely inconsistent sizes

so is there a handy way to do this?

image.default.width is not usefull because that alters images smaller then the 'page' width as well.

+3  A: 

Try <imagedata width="100%" scalefit="1">. It's on each image in the source XML I know, but it will scale with various output media sizes.

Check out this page on image sizing

carillonator
+1 for mentioning Bob Stayton's book. Images usually (ok, bitmap images) tend to have a fixed size so referring to it doesn't seem to be a bad thing.
Nic Gibson
thanks for the suggestion but this scales all images to the specified width.but i was looking to only scale images which dont fit.+1 for the book link tho
pvgoddijn