473,387 Members | 1,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

FOP Dynamic Heading Size?

Hi All,
I'm generating a pdf document using FOP .25 from Apache. I've created
running dynamic headings (e.g. chapter titles) that change as dictated
by the XML source I'm converting to PDF. Now thats fine. My clients
wish to include a variable length note as well in this page region.
Trouble is I've only been able to do this by statically sizing the
region to house this data. If no data (e.g. the note) exists for a
given heading - just white space is shown. The clients hate it and
apparently this is a show-stopping issue. A mustfix.

Is there a way to have the fo-region-before shrink / grow dynamically
based on the data display within that region?
Jul 20 '05 #1
1 1878
The size of a static-content region can't be dynamic, but you can calc
the size based on the size of your note. Ex:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">

<xsl:template match="/">
<fo:root>
<fo:layout-master-set>

<xsl:variable name="size" select="string-length(/xml/note/text()) div
50"/>

<fo:simple-page-master master-name="report_page_master"
page-height="11in" page-width="8.5in">
<fo:region-body region-name="xsl-region-body" margin=".5in"
margin-top="{$size}in"/>

....

This counts the number of chars making up the note node to calc the
size. You'll probaly want to figure out your own magic number instead
of 50, but you'll want to use that variable in the margin-top of
region-body and the extent of region-before.

Mike
de***********@moh.gov.on.ca (Devon) wrote in message news:<a7**************************@posting.google. com>...
Hi All,
I'm generating a pdf document using FOP .25 from Apache. I've created
running dynamic headings (e.g. chapter titles) that change as dictated
by the XML source I'm converting to PDF. Now thats fine. My clients
wish to include a variable length note as well in this page region.
Trouble is I've only been able to do this by statically sizing the
region to house this data. If no data (e.g. the note) exists for a
given heading - just white space is shown. The clients hate it and
apparently this is a show-stopping issue. A mustfix.

Is there a way to have the fo-region-before shrink / grow dynamically
based on the data display within that region?

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: duncan.lovett | last post by:
I want to generate dynamic heading images, but I won't be able to use the GD Library, ImageMagick or any other plug-in to generate an image on the fly due to hosting restrictions. I have seen,...
6
by: B McDonald | last post by:
Hi. According to http://www.w3.org/TR/REC-CSS2/sample.html ... h1=2em h2=1.5em h3=1.17em h4=??? h5=.83em h6=.67em I have defined them to be
6
by: Harlan Messinger | last post by:
A publication style guide indicates that for a table heading like the following, Table 3. Wheat and rye harvest in European countries in years that end in 3 or 7 or when a new prime minister...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
3
by: Richard MSL | last post by:
I have an owner drawn combobox with multiple columns. I would like to implement headings for the columns. I have attempted to do this within the DrawItem event, but there is no space, I can not...
1
by: erictomlinson | last post by:
I'm dying here trying to figure this out for days. Here's the scenario: 1) External script.as file dynamically imported to loader.swf file that creates a textfield (createTextField) 2)...
14
ollyb303
by: ollyb303 | last post by:
Hi, I am trying to create a dynamic crosstab report which will display number of calls handled (I work for a call centre) per day grouped by supervisor. I have one crosstab query (Query1) which...
1
by: neovantage | last post by:
Hey all, I am using a PHP script which creates headings at run time in a sense at page execution. I am stuck a with a very little problem which i am sure i will have the solution from experts. ...
2
by: neovantage | last post by:
Hey all, I have created transparent PNG images from text dynamically. But it edges are pixel-ate or we can say edges are distorted. Here is my LINK which shows my generated transparent PNG image....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.