Bug 38452 - Generating one Pdf document from several xml sources.
Summary: Generating one Pdf document from several xml sources.
Status: CLOSED WORKSFORME
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: page-master/layout (show other bugs)
Version: 0.91
Hardware: Other Linux
: P3 enhancement
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-30 17:57 UTC by Victor Andreev
Modified: 2012-04-01 13:53 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Andreev 2006-01-30 17:57:10 UTC
Now it is a problem to generate a big pdf document with many data. For example,
report based on a lot of different data. Usually "OutOfMemory" exception throws. 

My idea to generate pdf step by step,to create a lot of xml sources and one or
more xslfo source files. At first it is necessary to point FOP-builder that
specific transformation has been started and send the first xml,xslfo source and
pdf target to process. After the first transformation, send the next xml sources
to process and so on. When the last xml source remains, it needs to indicate
that it will be the last process. And Fop will complete generating pdf.

I released this logic in fop-0.20.5. I used old classes: Driver, FoTreeBuilder,
StreamRenderer. But some of this clasess have been changed or absented in new
version of Fop. Have you opportunity to realize generating only one pdf-document
based on a plenty of data?
Comment 1 Jeremias Maerki 2006-02-02 16:36:33 UTC
It seems you used FOP 0.20.5 in a way that was not really intended. This
operation has, until now, never been a supported operation. The redesign has
abviously removed the direct possibility to do again what you could do with
0.20.5. However, there are a few points that will help you:

1. Normally, concatenating documents to a single document should be done at XSLT
stage. FOP is designed to take one input document and generate one output
document. If this still you still get memory problem with the latest release if
you process one big document at once instead of multiple separate ones, we'd
like to know about it because this is something that should work. Would you
please do us the favor and retest processing the whole document in normal
fashion using 0.91beta? Thanks.

2. About a month ago, I introduce the "intermediate format". It allows you to
create an XML representation of the formatted document and save that as a file.
You can later reparse these intermediate files and concatenate them to one big
PDF file. If you download the latest FOP from Subversion (FOP Trunk), you can
follow the instructions in [1] to achieve what you want.

[1] http://xmlgraphics.apache.org/fop/trunk/intermediate.html

3. If you subclass org.apache.fop.area.AreaTreeHandler and override its
setupModel method you should be able to reuse the RenderPagesModel instance and
achieve the same effect as with 0.20.5. You will also need to instantiate the
AreaTreeHandler yourself and set it on the FOUserAgent using
setFOEventHandlerOverride(). Note that you need to know what you're doing here.  :-)

Good luck!
Comment 2 Jeremias Maerki 2006-02-09 08:26:17 UTC
I assume the problem is resolved. Closing the bug. Please reopen should anything
be unclear.
Comment 3 Glenn Adams 2012-04-01 13:53:06 UTC
batch transition to closed remaining pre-FOP1.0 resolved bugs