Re: AW: [xep-support] page height/width according to image size

From: W. Eliot Kimber <>
Date: Wed Dec 01 2004 - 11:15:12 PST

Wagner, Paul, VF-DE wrote:

> I would like to make my PDFs in this way (I don't know how big or small my image is before!):
> <fo:root xmlns:fo="">
> <fo:layout-master-set>
> <fo:simple-page-master master-name="autopage" page-height="auto" page-width="auto">
> // But I don't want get A4-Page-Format here!!!!!
> <fo:region-body region-name="body"/>

There's no way to do this in FO--the page and page region dimensions
must be explicitly specified.

However, you can use a Java XSLT extension to examine your images to get
their intrinsic size and then generate the appropriate page dimensions.
We use the Sun-provided JAI (Java Advanced Imaging) library to do this.

The basic technique is:


RenderedOp img = JAI.create("fileload", fileName);
// fileName is graphic filename, naturally
height = String.valueOf(img.getHeight());
width = String.valueOf(img.getWidth());



W. Eliot Kimber
Professional Services
Innodata Isogen
9390 Research Blvd, #410
Austin, TX 78759
(512) 372-8122
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service
Received on Wed Dec 1 11:58:30 2004

This archive was generated by hypermail 2.1.8 : Wed Dec 01 2004 - 11:58:32 PST