473,804 Members | 2,191 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1908
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:styleshe et 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_pa ge_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***********@m oh.gov.on.ca (Devon) wrote in message news:<a7******* *************** ****@posting.go ogle.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
1516
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, in the past, sites that generate headings from a set of Gif images, each corresponding to a letter in the string that is being turned into a graphical heading. I've searched in vain on a technique on how to do this, but all I can find is the GD...
6
5512
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
6702
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 takes office. when the heading flows over more than one line, a hanging indent should be used, such that the remainder of the heading should be left-aligned, in this example, with "Wheat", leaving "Table 3. " standing off by itself on the left.
1
17685
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 Create a Dynamic Crosstab Report PRODUCT :Microsoft Access PROD/VER:1.00 1.10 OPER/SYS:WINDOWS
3
1669
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 draw outside the region, and if I move where the items are drawn (down from e.Bounds.Y) to make space, the selection bar no longer lines up. I would appreciate any suggestions about how to handle this. Is there a better event to be drawing the...
1
5619
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) Content for the text field should be provided by an XML file 3) Content styled by external css file 4) Fonts need to be embedded so as to apply anti-alias
14
7866
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 has the following fields: SPID (supervisor ID), total:group by, as row heading Date, total:group by, as column heading Calls handled, total:sum, as value Date, total:where, criteria between and - this is taken from a form,
1
3395
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. The problem is when it creates transparent PNG format image then and it pixel ate the image. e.g. If i am using a gradient in background then it vary in color range. Now when i used that php script it generates image successfully but it pixel ate...
2
3485
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. Can someone help me out to sort out my problem i will be very grateful to him as i am stuck bad with this issue and i am not figuring out how to fix this. Here is my Code which generate transparent PNG images <img...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10603
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10353
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10356
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10099
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9176
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.