using multiple page sequences

2004-03-12 Thread Fleetwood, Brett (SSABSA)
Hi all,

I am having out of memory issues when transforming my FO - PDF using
fop-0.20.5rc2. I read that using multiple page sequences in the XSL and
therefore in the FO means that fop will release some memory. I don't see how
I can do this. My XML file is generated dynamically from a database so I
don't know how big it will be. Is there any solutions I can use that uses
multiple page sequences or possible change the xml structure, if not is
there another FOP transformer that isn't as memory intensive. Thanks in
advanced for any help. If I havn't provided enough info please ask and I can
get back to you.

?xml version=1.0 encoding=UTF-8?
report
group name=body
group name=school
title![CDATA[High School (001)]]/title
group name=candidate
group name=details
record
field
name=registration![CDATA[123456]]/field
field
name=givens![CDATA[John Doel]]/field
field
name=surname![CDATA[Smith]]/field
field
name=gender![CDATA[M]]/field
field name=date of
birth![CDATA[03 August 1985]]/field
/record
record
field
name=registration![CDATA[123456]]/field
field
name=givens![CDATA[John Doel]]/field
field
name=surname![CDATA[Smith]]/field
field
name=gender![CDATA[M]]/field
field name=date of
birth![CDATA[03 August 1985]]/field
/record
record
field
name=registration![CDATA[123456]]/field
field
name=givens![CDATA[John Doel]]/field
field
name=surname![CDATA[Smith]]/field
field
name=gender![CDATA[M]]/field
field name=date of
birth![CDATA[03 August 1985]]/field
/record
...
/group
/group
/group
/group
/report

And the XSL looks like this.

?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:output indent=yes/
xsl:template match=text()|@*/
xsl:template match=*/

xsl:template match=/
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;

fo:layout-master-set
fo:simple-page-master master-name=A4
page-width=297mm page-height=210mm margin-top=5mm margin-bottom=5mm
margin-left=15mm margin-right=15mm
fo:region-before extent=95mm/
fo:region-body margin-top=5mm
margin-bottom=5mm/
fo:region-after extent=10mm/
/fo:simple-page-master

/fo:layout-master-set

fo:page-sequence master-reference=contents
fo:flow flow-name=xsl-region-body
fo:blockthis is some test
text/fo:block
xsl:apply-templates/
/fo:flow
/fo:page-sequence


/fo:root
/xsl:template

xsl:template match=report
xsl:apply-templates select=group/group/group/group/
/xsl:template

xsl:template match=group
xsl:apply-templates select=record/
/xsl:template

xsl:template match=record
fo:blockxsl:value-of
select=[EMAIL PROTECTED]'givens']//fo:block
fo:blockxsl:value-of
select=[EMAIL PROTECTED]'gender']//fo:block
fo:blockxsl:value-of
select=[EMAIL PROTECTED]'surname']//fo:block
fo:blockxsl:value-of select=[EMAIL PROTECTED]'date of
birth']//fo:block
/xsl:template
/xsl:stylesheet

---
BRETT FLEETWOOD
Analyst/Programmer


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: using multiple page sequences

2004-03-12 Thread John Austin
On Thu, 2004-03-11 at 22:02, Fleetwood, Brett (SSABSA) wrote:
 Hi all,
 
Quick question: Have you increased the memory available to your JVM ?
If you are using the JVM default, your easiest solution might be to
increase the memory available. This depends on your system having enough
real memory to support it and varies by JVM vendor. 

So what is your environment ?

OS, real memory available, Java Version ?


What is your command line used to invoke Fop ? 


 I am having out of memory issues when transforming my FO - PDF using
 fop-0.20.5rc2. I read that using multiple page sequences in the XSL and

There is a production release of 0.20.5

 therefore in the FO means that fop will release some memory. I don't see how
 I can do this. My XML file is generated dynamically from a database so I
 don't know how big it will be. Is there any solutions I can use that uses
 multiple page sequences or possible change the xml structure, if not is
 there another FOP transformer that isn't as memory intensive. Thanks in
 advanced for any help. If I havn't provided enough info please ask and I can
 get back to you.

See above
-- 
John Austin [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: using multiple page sequences

2004-03-12 Thread Fleetwood, Brett (SSABSA)
Thanks for you response John, hopefully I can answer your questions. From
what I understand, we have a web-based application that uses Linux
Apache-Tomcat as the web-server to do the rendering. This is a decent
machine and we have allocated extra memory (approx 1Gb) but being a web-app
possibly many users can request data to be rendered into PDF at the same
time therefore I need to keep things as small as possible. I'm not sure
throwing more resources at it will ultimately fix it, I think that the
actual XSL needs to change or possibly use a different rendorer.

Has anyone had experience in setting up a machine to solely perform
transformations?

-Original Message-
From: John Austin [mailto:[EMAIL PROTECTED]
Sent: Friday, 12 March 2004 1:01 PM
To: [EMAIL PROTECTED]
Subject: Re: using multiple page sequences


On Thu, 2004-03-11 at 22:02, Fleetwood, Brett (SSABSA) wrote:
 Hi all,
 
Quick question: Have you increased the memory available to your JVM ?
If you are using the JVM default, your easiest solution might be to
increase the memory available. This depends on your system having enough
real memory to support it and varies by JVM vendor. 

So what is your environment ?

OS, real memory available, Java Version ?


What is your command line used to invoke Fop ? 


 I am having out of memory issues when transforming my FO - PDF using
 fop-0.20.5rc2. I read that using multiple page sequences in the XSL and

There is a production release of 0.20.5

 therefore in the FO means that fop will release some memory. I don't see
how
 I can do this. My XML file is generated dynamically from a database so I
 don't know how big it will be. Is there any solutions I can use that uses
 multiple page sequences or possible change the xml structure, if not is
 there another FOP transformer that isn't as memory intensive. Thanks in
 advanced for any help. If I havn't provided enough info please ask and I
can
 get back to you.

See above
-- 
John Austin [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: using multiple page sequences

2004-03-12 Thread Glen Mazza
Fleetwood, Brett (SSABSA) schrieb:
I read that using multiple page sequences in the XSL and
therefore in the FO means that fop will release some memory. 

The ML archives seem to indicate that, but I'm unsure how significant 
the savings would be.  It might not be worth the effort.  I'm currently 
looking in this area for our newer version (1.0) and hopefully 
band-aids such as these will not be necessary in the future.

Is there any solutions I can use that uses
multiple page sequences or possible change the xml structure, if not is
there another FOP transformer that isn't as memory intensive. 

RenderX and AntennaHouse are the main commercial implementations.
			
fo:layout-master-set
	fo:simple-page-master master-name=A4
	/fo:simple-page-master		
/fo:layout-master-set
		
fo:page-sequence master-reference=contents
 

Hmmm...I guess I'm missing something here--doesn't the master reference 
(contents) need to refer to the master-name of the simple-page-master 
(A4)?

Glen
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: using multiple page sequences

2004-03-12 Thread Fleetwood, Brett (SSABSA)
Cheers Glen, Are you on the FOP dev team? Is 1.0 far away? I'll look into
these other implementations. You are right the XSL won't work, I was
originally playing around with page-sequence-master master-name =
contents but removed it as it wasn't useful, and obviously forgot to
change the rest. Thanks again.

bF.

-Original Message-
From: Glen Mazza [mailto:[EMAIL PROTECTED]
Sent: Friday, 12 March 2004 3:07 PM
To: [EMAIL PROTECTED]
Subject: Re: using multiple page sequences


Fleetwood, Brett (SSABSA) schrieb:

I read that using multiple page sequences in the XSL and
therefore in the FO means that fop will release some memory. 

The ML archives seem to indicate that, but I'm unsure how significant 
the savings would be.  It might not be worth the effort.  I'm currently 
looking in this area for our newer version (1.0) and hopefully 
band-aids such as these will not be necessary in the future.

Is there any solutions I can use that uses
multiple page sequences or possible change the xml structure, if not is
there another FOP transformer that isn't as memory intensive. 

RenderX and AntennaHouse are the main commercial implementations.

   
fo:layout-master-set
   fo:simple-page-master master-name=A4
   /fo:simple-page-master
/fo:layout-master-set
   
fo:page-sequence master-reference=contents
  

Hmmm...I guess I'm missing something here--doesn't the master reference 
(contents) need to refer to the master-name of the simple-page-master 
(A4)?

Glen

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: using multiple page sequences

2004-03-12 Thread Glen Mazza
Yes, 1.0 is far away, but we keep working on it.  Every day it's getting 
better formed.

Glen
Cheers Glen, Are you on the FOP dev team? Is 1.0 far away? I'll look into
these other implementations. You are right the XSL won't work, I was
originally playing around with page-sequence-master master-name =
contents but removed it as it wasn't useful, and obviously forgot to
change the rest. Thanks again.
bF.
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


FOP commands to XSL

2004-03-12 Thread Benjohn P. Villedo
hi all,

Good Day!!!

i am really new to this thus the experimentation. i wanted to create 
tables that are side by side each other like on a page i have 5 tables 
aligned side by side with each other... am really not sure how this is 
done but as far as reading is concerned i came across block-
containers property i was wondering if you could help me convert 
these lines FO to XSL lines


fo:block-container border-color=black border-style=solid border-
width=.5mm height=0.5cm width=8.95
cm top=3cm left=0cm padding=.6mm position=absolute
fo:block text-align=start line-height=14pt font-
family=sans-serif font-size=12pt
SOLD TO
/fo:block
/fo:block-container


i just found those lines in the example/fo/basic/border.fo file which 
clearly works on this url 
http://www.chpii.com:8080/fop?fo=/usr/local/fop/examples/fo/basic/b
order.fo

now since we are getting data from a dynamic source the approach 
was to create an XML file then use the XSL file to translate the XML 
file then further convert it to PDF file

inside the XSL file i tried this but didn't work

xsl:template match=block_table
  fo:block-container border-color=black
  border-style=solid
  border-width=.5mm
  height=0.5cm
  width=8.95cm
  top=3cm
  left=0cm
  padding=.6mm
  position=absolute
fo:block text-align=start 
   line-height=14pt 
   font-family=sans-serif 
   font-size=12pt
  xsl:apply-templates/   
   /fo:block
  /fo:block-container
/xsl:template



inside the XML file i tried

block_table
this is a test
/block_table


but the browser gave me the error

Failed To Execute Pipeline
org.apache.cocoon.ProcessingException: Failed to execute 
pipeline.: java.lang.RuntimeException: 
java.lang.ClassCastException: org.apache.fop.layout.BlockArea


hope you could help me in this endeavor... all the best!!


pal,
benjohn

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: FOP commands to XSL

2004-03-12 Thread Andreas L. Delmelle
 -Original Message-
 From: Benjohn P. Villedo [mailto:[EMAIL PROTECTED]

snip /

 but the browser gave me the error
 
 Failed To Execute Pipeline
 org.apache.cocoon.ProcessingException: Failed to execute
 pipeline.: java.lang.RuntimeException:
 java.lang.ClassCastException: org.apache.fop.layout.BlockArea
 

 hope you could help me in this endeavor... all the best!!


At first glance there seems to be nothing intrinsically wrong with your
code...
Can you perform the transformation in a separate step for debugging, and
post us the resulting FO (or a minimized version)?


Cheers,

Andreas


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FOP commands to XSL

2004-03-12 Thread Chris Bowditch
Benjohn P. Villedo wrote:
snip/
but the browser gave me the error

Failed To Execute Pipeline
org.apache.cocoon.ProcessingException: Failed to execute 
pipeline.: java.lang.RuntimeException: 
java.lang.ClassCastException: org.apache.fop.layout.BlockArea


hope you could help me in this endeavor... all the best!!
ClassCastException can occur when working when block-containers if the 
block-container is not a direct descendent of the flow element. This is 
simply a limitation of FOP. You will need to change your XSL stylesheet 
to make sure the block-container appears only as a direct descendent of 
the flow element. As Andreas suggested, to help you in this task you may 
need to output the intermediate XSL-FO. See below link on how to do this 
from XML and XSL files:

http://xml.apache.org/fop/running.html#check-input
Chris


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: using multiple page sequences

2004-03-12 Thread Fabrizio Tringali
Hi Brett,
It's not about faith, spanning datas across multiple page sequences 
brings an huge memory saving.
We solve issue of constant OutOfMemory errors (according to heap 
allocation) going to about 2 MB memory consumption on fully written 100 
pages documents.

You have to identify where in your document could be inserted a page break
or
decide to break intentionally after N rows of datas (1 record on your XML 
file can be M rows on document so M*N is the total rows on document)

In the second case put logic for break when ciclying your datas templates 
using something like this ($STOP is max number of data rows for page):

xsl:for-each select=DATA_ROW[position() mod $STOP = 1]
fo:page-sequence master-reference=YOUR_MASTER_REFERENCE 
initial-page-number=auto
fo:flow flow-name=xsl-region-body
fo:table table-layout=fixed width=480pt
fo:table-column column-width=85pt/
fo:table-column column-width=15pt/
fo:table-body
fo:table-row line-height=30pt
fo:table-cell
fo:block 
text-align=center font-size=10pt font-family=Couriertitle 1/fo:block
/fo:table-cell
fo:table-cell
fo:block 
text-align=center font-size=10pt font-family=Couriertitle 2/fo:block
/fo:table-cell
/fo:table-row
   /fo:table-body
/fo:table
xsl:for-each 
select=.|following-sibling::DATA_ROW[position() lt; $STOP]
xsl:apply-templates select=./
/xsl:for-each
/fo:flow
/fo:page-sequence
/xsl:for-each

xsl:template match=DATA_ROW
fo:table table-layout=fixed width=480pt
fo:table-column column-width=85pt/
fo:table-column column-width=10pt/
fo:table-body
fo:table-row line-height=13pt
fo:table-cell
fo:block text-align=left 
font-size=10pt font-family=Courier
xsl:value-of 
select=YOUR_ROW_KEY_1/
/fo:block
/fo:table-cell
fo:table-cell
fo:block text-align=center 
font-size=10pt font-family=Courier
xsl:value-of 
select=YOUR_ROW_KEY_2/
/fo:block
/fo:table-cell
/fo:table-row
/fo:table-body
/fo:table
/xsl:template

Hope this help
fabrizio
At 02.32 12/03/2004, you wrote:
Hi all,
I am having out of memory issues when transforming my FO - PDF using
fop-0.20.5rc2. I read that using multiple page sequences in the XSL and
therefore in the FO means that fop will release some memory. I don't see how
I can do this. My XML file is generated dynamically from a database so I
don't know how big it will be. Is there any solutions I can use that uses
multiple page sequences or possible change the xml structure, if not is
there another FOP transformer that isn't as memory intensive. Thanks in
advanced for any help. If I havn't provided enough info please ask and I can
get back to you.
Defend your privacy! Encrypt your email today! 
http://www.bytefusion.com/secexmail 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: using multiple page sequences

2004-03-12 Thread John Austin
On Thu, 2004-03-11 at 23:32, Fleetwood, Brett (SSABSA) wrote:
 Thanks for you response John, hopefully I can answer your questions. From
 what I understand, we have a web-based application that uses Linux
 Apache-Tomcat as the web-server to do the rendering. This is a decent
 machine and we have allocated extra memory (approx 1Gb) but being a web-app
 possibly many users can request data to be rendered into PDF at the same
 time therefore I need to keep things as small as possible. I'm not sure
 throwing more resources at it will ultimately fix it, I think that the
 actual XSL needs to change or possibly use a different rendorer.
 
 Has anyone had experience in setting up a machine to solely perform
 transformations?

I asked about memory on the machine and about the command line arguments
used to invoke your environment as a sanity-check to make sure that your
Java VM (in this case Tomcat ?) is configured with a large enough heap
to support your program. It could explain why your application runs out
of heap. There are reasons WHY it requires this much memory, that we
don't want to go in to here.

Simply plugging in a few memory cards isn't enough. Java has to know the
size of the heap (free store) that it is allowed to create. For the Sun
Java, use the commands: java -j  and java -X to see the options.

In Tomcat 5, you could use the environment variable JAVA_OPTS to pass
in a value for -Xmx, say JAVA_OPTS=-Xmx800M to  allow an 800 Mb heap.

This isn't a perfect solution, but it could help you get to the next
level and keep you alive while you consider your commercial options.

-- 
John Austin [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Print on demand using FOP

2004-03-12 Thread Mike Brodbelt
Hi,

We're using FOP to generate print-ready pages directly from information
held in a database. We're essentially hold directory type information in
the database, and we periodically print a new edition of the directory.

During the editing process, we have a dataflow set up so that an end
user goes to an internal webpage, and submits a form. That form calls
some Perl code, which sucks data out of a database, and formats it as
XML using XML::Writer. That XML is then fed into FOP, along with a
pre-defined stylesheet, and the Perl code then returns that generated
PDF data to the browser. The whole experience is seamless to the user,
and allows previewing of pages direct from the database. The user can
then correct/update information in the database, and regenerate the
output page at will.

When we're ready, we freeze the database, download the whole dataset,
and generate a PDF that's ready for final printing.

One of the big problems we have with this setup is the lack of widow and
orphan control in FOP. It's vital to us that we can control where column
and page breaks fall, and we are currently only able to do this by doing
ugly temporary hacks on the stylesheet, or post FOP fixups on the PDF
file in Adobe Acrobat. Each time we want a final press ready PDF we have
to redo these hacks, as they're data specific.

How do other people deal with this? Is there any way to exercise control
over the positioning of pacge breaks without needing widow/orphan
support? Any work rounds possible. Failing that (stupid question alert),
any idea when a version of FOP that supports this might make an appearance?

TIA,

Mike.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]