Hi Franz Thanks for explaining. That really helped. I guess you've got a use case where using pixels is actually making sense despite my earlier comment.
Try this: - Make sure you set both the source-resolution and the target-resolution setting in the FOP configuration to 72dpi (or 96, it's important that both are the same). - Make sure you specify the page size and any borders using pixels. I used this FO for testing: <?xml version="1.0" encoding="UTF-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="sans-serif" font-size="12px"> <fo:layout-master-set> <fo:simple-page-master master-name="A4" page-height="320px" page-width="208px" margin="2px"> <fo:region-body/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="A4"> <fo:flow flow-name="xsl-region-body"> <fo:block>Hello World with Apache FOP!</fo:block> </fo:flow> </fo:page-sequence> </fo:root> From my config file: [..] <source-resolution>72</source-resolution> <target-resolution>72</target-resolution> [..] The above generated a PNG file with 72dpi and 208x320 pixels. HTH On 25.05.2007 17:04:06 fma-001 wrote: > > Hi Jeremias! > > For your background: I would like to display an image on a mobile Phone. For > this I plan to create a png, so it fits perfect to the width of the cell > phone - so I haven't any hassle with formatting on that mobile device. The > image should be just a simple table with a few entries. > > I found out that FOP is able to generate png-images, so I tried to create > images through FOP - which works fine. I read an XML and format the content > with XSL-FO to generate an image with an ordinary table. The problem is that > the table might be just 50px in height, but the png is always 792px!! But I > want that the pic should just have the height of the table - if the table > needs 50px then the pic should be just 50px, if the table needs 1000px, the > png should be 1000px. > > I hope I could explain my problem a bit clearer! > > Thank you, Franz > > > Jeremias Maerki-2 wrote: > > > > Hi Franz > > > > I have trouble understanding what you're trying to do. Maybe you could > > explain again in other words? Post a snippet of your current FO to > > illustrate. That should help us help you. > > > > On a general note, it's not such a good idea to work with pixels when > > specifying lengths in XSL-FO. That's fine in a browser but very > > environment-dependant for XSL-FO. > > > > On 21.05.2007 09:23:47 fma-001 wrote: > >> > >> Hi all! > >> > >> I am creating png-Graphics with Apache FOP 0.93. I generate graphics in a > >> fixed width (e.g. 320 px). The heigth should be as height as content does > >> require. But at the moment FOP always creates png's with a height of 792 > >> px! > >> > >> How can I manage FOP to create a image with optimized height? > > > > > > Jeremias Maerki > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > View this message in context: > http://www.nabble.com/FOP0.93%3A-png-output-in-optimized-height-tf3788704.html#a10804833 > Sent from the FOP - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] Jeremias Maerki --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
