You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by "Giorgio Mannelli@Eastway" <gm...@eastway.it> on 2006/05/11 17:35:08 UTC
page-sequence and memory useage
I have a quite big fo file generated programmatically in this way:
<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master page-height="210mm" page-width="297mm"
margin="10mm 2mm 2mm 2mm" master-name="PageMaster">
<fo:region-before region-name="header" extent="15mm"
display-align="before"/>
<fo:region-body margin="10mm 3mm 3mm 3mm"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence initial-page-number="1" master-reference="PageMaster">
<fo:static-content flow-name="header">
<fo:block font-size="8pt" text-align="center">
something
</fo:block>
<fo:block font-size="8pt" text-align="center">
Anno: 2005 / Pagina: <fo:page-number/>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
lot's of things feeded via java trough a loop
</fo:flow>
</fo:page-sequence>
</fo:root>
I need to generate a PDF file of about 1500 - 2000 pages but I got
OutOfMemory (even If I use a large amount (more than 350 Mb) of it).
I red about use more than one page-sequence but I can't split it in
pages by my own hands because I dunno after how many iterations The
document reach the end of a page.
thanks in advance, best regrds
Giorgio
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: page-sequence and memory useage
Posted by "Giorgio Mannelli@Eastway" <gm...@eastway.it>.
Thank you very much for your reply. I think it could be very useful to
write it in the documentation as a disclaimer. I mean FOP is a beatiful
project. Lots of people, like my company, would choose it as a component
of thier application in production environment but I think that warn
them about the fact that there are no way to use it with more then ca
50-100 pages BEFORE they start using it would be very appreciated.
Anyway, keep up your very good work and thank you very much.
Regards
Giorgio
Jeremias Maerki wrote:
> In this case, you have a problem with FOP. Splitting the document into
> multiple page-sequences is the only current work-around (except
> increasing the available memory). You will have to find a way to
> manually determine where you need to break a page. The only other option
> is to allocate resources to the FOP project and help us improve handling
> of large volumes.
>
> On 11.05.2006 17:35:08 Giorgio Mannelli@Eastway wrote:
>
>>I have a quite big fo file generated programmatically in this way:
>>
>><?xml version="1.0" encoding="UTF-8"?>
>><fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
>> <fo:layout-master-set>
>> <fo:simple-page-master page-height="210mm" page-width="297mm"
>>margin="10mm 2mm 2mm 2mm" master-name="PageMaster">
>> <fo:region-before region-name="header" extent="15mm"
>>display-align="before"/>
>> <fo:region-body margin="10mm 3mm 3mm 3mm"/>
>> </fo:simple-page-master>
>> </fo:layout-master-set>
>> <fo:page-sequence initial-page-number="1" master-reference="PageMaster">
>> <fo:static-content flow-name="header">
>> <fo:block font-size="8pt" text-align="center">
>>something
>> </fo:block>
>> <fo:block font-size="8pt" text-align="center">
>> Anno: 2005 / Pagina: <fo:page-number/>
>> </fo:block>
>> </fo:static-content>
>> <fo:flow flow-name="xsl-region-body">
>>
>>lot's of things feeded via java trough a loop
>>
>> </fo:flow>
>> </fo:page-sequence>
>></fo:root>
>>
>>
>>I need to generate a PDF file of about 1500 - 2000 pages but I got
>>OutOfMemory (even If I use a large amount (more than 350 Mb) of it).
>>
>>I red about use more than one page-sequence but I can't split it in
>>pages by my own hands because I dunno after how many iterations The
>>document reach the end of a page.
>
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>
--
Dott. Giorgio Mannelli
Eastway CMC Studios
via della Cernaia, 20
50129 Firenze
tel: 0555158287
mob: 3496752669
www.eastway.it
Re: page-sequence and memory useage
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
In this case, you have a problem with FOP. Splitting the document into
multiple page-sequences is the only current work-around (except
increasing the available memory). You will have to find a way to
manually determine where you need to break a page. The only other option
is to allocate resources to the FOP project and help us improve handling
of large volumes.
On 11.05.2006 17:35:08 Giorgio Mannelli@Eastway wrote:
> I have a quite big fo file generated programmatically in this way:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> <fo:layout-master-set>
> <fo:simple-page-master page-height="210mm" page-width="297mm"
> margin="10mm 2mm 2mm 2mm" master-name="PageMaster">
> <fo:region-before region-name="header" extent="15mm"
> display-align="before"/>
> <fo:region-body margin="10mm 3mm 3mm 3mm"/>
> </fo:simple-page-master>
> </fo:layout-master-set>
> <fo:page-sequence initial-page-number="1" master-reference="PageMaster">
> <fo:static-content flow-name="header">
> <fo:block font-size="8pt" text-align="center">
> something
> </fo:block>
> <fo:block font-size="8pt" text-align="center">
> Anno: 2005 / Pagina: <fo:page-number/>
> </fo:block>
> </fo:static-content>
> <fo:flow flow-name="xsl-region-body">
>
> lot's of things feeded via java trough a loop
>
> </fo:flow>
> </fo:page-sequence>
> </fo:root>
>
>
> I need to generate a PDF file of about 1500 - 2000 pages but I got
> OutOfMemory (even If I use a large amount (more than 350 Mb) of it).
>
> I red about use more than one page-sequence but I can't split it in
> pages by my own hands because I dunno after how many iterations The
> document reach the end of a page.
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: page-sequence and memory usage
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 15.05.2006 17:10:00 Giorgio Mannelli@Eastway wrote:
> Jeremias Maerki wrote:
>
> > That's where it gets tricky, at least for this particular issue.
> > Supporting large documents will take some rather extensive changes in
> > the layout engine:
> > - Introduction of a first-fit page breaking algorithm which is selected
> > on demand.
> > etc...
>
> Thank you for the explanation.
>
> > We can point anyone willing to
> > dive in to the right spots in the code and the right book to read.
>
> Where can I find more documentation about FOP's architecture?
In our Wiki: http://wiki.apache.org/xmlgraphics-fop/DeveloperPages
A whole section of that page contains links to pages where we've written
down our thoughts and our research results.
http://wiki.apache.org/xmlgraphics-fop/KnuthsModel contains information
about an article/book by Donald Knuth who defined the model we're using
in the layout engine. This article is the basic building block for the
design of the layout engine. A must read.
If you need any additional info or if anything is unclear, please just
ask.
> > As an alternative you can find someone who will implement the above for you.
> > There are some people on this list who might be available for that.
>
> How can I ask for this people's help?
That's easy. Just call out on this list or on fop-dev. If there's
someone available he/she will get in touch with you.
> I am sorry If I could seem obnoxious about this problem but I think
> that a solution to the problem of the page-squence would be helpful for
> all the people who choosed FOP, not only for me.
Hey, no problem. I'm actually very happy that you're so persistent about
it. Shows that you really care. Other people would have given up by now
and bought a commercial product most probably becoming unhappy about the
supplier in a year or two. I've seen it. :-) Only a few see the true
merit of open source and joint development.
You're absolutely correct that fixing this problem will help a lot of
people, especially those using FOP to produce documentation and large
reports. This will help make FOP better again attracting new user and
potential developers and supporters. FOP lives from the people who take
action inside the project, be that by answering questions on fop-users,
sending patches and possibly becoming a committer after some time etc.
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: page-sequence and memory usage
Posted by "Giorgio Mannelli@Eastway" <gm...@eastway.it>.
Jeremias Maerki wrote:
> That's where it gets tricky, at least for this particular issue.
> Supporting large documents will take some rather extensive changes in
> the layout engine:
> - Introduction of a first-fit page breaking algorithm which is selected
> on demand.
> etc...
Thank you for the explanation.
> We can point anyone willing to
> dive in to the right spots in the code and the right book to read.
Where can I find more documentation about FOP's architecture?
> As an alternative you can find someone who will implement the above for you.
> There are some people on this list who might be available for that.
How can I ask for this people's help?
I am sorry If I could seem obnoxious about this problem but I think
that a solution to the problem of the page-squence would be helpful for
all the people who choosed FOP, not only for me.
Thank you very much,
Giorgio
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: page-sequence and memory usage
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 15.05.2006 11:57:00 Giorgio Mannelli@Eastway wrote:
> Thank you for your replay, but I still need some info:
> 1) how can I help you?
That's where it gets tricky, at least for this particular issue.
Supporting large documents will take some rather extensive changes in
the layout engine:
- Introduction of a first-fit page breaking algorithm which is selected
on demand.
- Layout managers won't produce complete element lists anymore, only up
to the point that a page can be filled. Therefore, layout managers must
be able to restart at a particular point. In this case, the table layout
manager is the biggest problem because it can't do that, yet. The other
layout managers should be easier here as they already support that.
- Optional: Reintroduce restartability into the layout managers for the
case where the available width of a page changes from one page to the
other. In this case, line break decisions have to be redone and the
block-progression element list regenerated.
- Free FO tree resources and layout managers as soon as certain FO
elements have been fully produced on pages.
- Improve the area tree storage to save unresolved pages to disk. This
already exists but isn't hooked into FOP's normal operation, yet.
Alternatively, implement a two-pass approach for resolving
page-number-citations. The latter will provide us with a higher
probability to get the layout right when page-number-citations are used
while keeping the memory consumption low because no pages have to be
kept in memory or disk until they can be rendered to the final format.
To implement the above, deep knowledge about the Knuth element design
and FOP's layout engine will be required. We can point anyone willing to
dive in to the right spots in the code and the right book to read. As an
alternative you can find someone who will implement the above for you.
There are some people on this list who might be available for that. I do
this kind of work but in the near future (next 3-5 months) I don't think
I have enough time to take on such a big task myself.
> 2) there is something planned about the unlimited page-sequence problem?
Some of that is on my long-term task list, but for the moment it is a
rather low priority for me. None of my clients nor I create documents
with page-sequences larger than two dozen pages. Otherwise, I know of
noone who is planning to do this.
> Best regards,
> Giorgio
>
> Jeremias Maerki wrote:
> > The goal defined back then is still valid, but so far functionality was
> > more important than handling large documents. If this is very very very
> > important to you, then please consider allocating resources to help us
> > implement it. This is open source; everybody can help.
> >
> > On 12.05.2006 18:03:55 Giorgio Mannelli@Eastway wrote:
> >
> >>BTW, I found a very old topic discussed on the fop-dev list
> >>(http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-dev/200305.mbox/%3cPAEOKILLLBAPHPPDDBNLGEGKEAAA.vic@outfitr.com%3e)
> >>about possibility of arbitrary size page-sequence. Anyone know a fallow
> >>up of this? There is a planned release of this very very very important fix?
<snip/>
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: page-sequence and memory useage
Posted by "Giorgio Mannelli@Eastway" <gm...@eastway.it>.
Thank you for your replay, but I still need some info:
1) how can I help you?
2) there is something planned about the unlimited page-sequence problem?
Best regards,
Giorgio
Jeremias Maerki wrote:
> The goal defined back then is still valid, but so far functionality was
> more important than handling large documents. If this is very very very
> important to you, then please consider allocating resources to help us
> implement it. This is open source; everybody can help.
>
> On 12.05.2006 18:03:55 Giorgio Mannelli@Eastway wrote:
>
>>BTW, I found a very old topic discussed on the fop-dev list
>>(http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-dev/200305.mbox/%3cPAEOKILLLBAPHPPDDBNLGEGKEAAA.vic@outfitr.com%3e)
>>about possibility of arbitrary size page-sequence. Anyone know a fallow
>>up of this? There is a planned release of this very very very important fix?
>>
>>Giorgio Mannelli@Eastway wrote:
>>
>>>I have a quite big fo file generated programmatically in this way:
>>>
>>><?xml version="1.0" encoding="UTF-8"?>
>>><fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
>>> <fo:layout-master-set>
>>> <fo:simple-page-master page-height="210mm" page-width="297mm"
>>>margin="10mm 2mm 2mm 2mm" master-name="PageMaster">
>>> <fo:region-before region-name="header" extent="15mm"
>>>display-align="before"/>
>>> <fo:region-body margin="10mm 3mm 3mm 3mm"/>
>>> </fo:simple-page-master>
>>> </fo:layout-master-set>
>>> <fo:page-sequence initial-page-number="1"
>>>master-reference="PageMaster">
>>> <fo:static-content flow-name="header">
>>> <fo:block font-size="8pt" text-align="center">
>>>something
>>> </fo:block>
>>> <fo:block font-size="8pt" text-align="center">
>>> Anno: 2005 / Pagina: <fo:page-number/>
>>> </fo:block>
>>> </fo:static-content>
>>> <fo:flow flow-name="xsl-region-body">
>>>
>>>lot's of things feeded via java trough a loop
>>>
>>> </fo:flow>
>>> </fo:page-sequence>
>>></fo:root>
>>>
>>>
>>>I need to generate a PDF file of about 1500 - 2000 pages but I got
>>>OutOfMemory (even If I use a large amount (more than 350 Mb) of it).
>>>
>>>I red about use more than one page-sequence but I can't split it in
>>>pages by my own hands because I dunno after how many iterations The
>>>document reach the end of a page.
>>>
>>>thanks in advance, best regrds
>>>Giorgio
>
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: page-sequence and memory useage
Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
The goal defined back then is still valid, but so far functionality was
more important than handling large documents. If this is very very very
important to you, then please consider allocating resources to help us
implement it. This is open source; everybody can help.
On 12.05.2006 18:03:55 Giorgio Mannelli@Eastway wrote:
> BTW, I found a very old topic discussed on the fop-dev list
> (http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-dev/200305.mbox/%3cPAEOKILLLBAPHPPDDBNLGEGKEAAA.vic@outfitr.com%3e)
> about possibility of arbitrary size page-sequence. Anyone know a fallow
> up of this? There is a planned release of this very very very important fix?
>
> Giorgio Mannelli@Eastway wrote:
> > I have a quite big fo file generated programmatically in this way:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> > <fo:layout-master-set>
> > <fo:simple-page-master page-height="210mm" page-width="297mm"
> > margin="10mm 2mm 2mm 2mm" master-name="PageMaster">
> > <fo:region-before region-name="header" extent="15mm"
> > display-align="before"/>
> > <fo:region-body margin="10mm 3mm 3mm 3mm"/>
> > </fo:simple-page-master>
> > </fo:layout-master-set>
> > <fo:page-sequence initial-page-number="1"
> > master-reference="PageMaster">
> > <fo:static-content flow-name="header">
> > <fo:block font-size="8pt" text-align="center">
> > something
> > </fo:block>
> > <fo:block font-size="8pt" text-align="center">
> > Anno: 2005 / Pagina: <fo:page-number/>
> > </fo:block>
> > </fo:static-content>
> > <fo:flow flow-name="xsl-region-body">
> >
> > lot's of things feeded via java trough a loop
> >
> > </fo:flow>
> > </fo:page-sequence>
> > </fo:root>
> >
> >
> > I need to generate a PDF file of about 1500 - 2000 pages but I got
> > OutOfMemory (even If I use a large amount (more than 350 Mb) of it).
> >
> > I red about use more than one page-sequence but I can't split it in
> > pages by my own hands because I dunno after how many iterations The
> > document reach the end of a page.
> >
> > thanks in advance, best regrds
> > Giorgio
Jeremias Maerki
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: page-sequence and memory useage
Posted by "Giorgio Mannelli@Eastway" <gm...@eastway.it>.
BTW, I found a very old topic discussed on the fop-dev list
(http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-dev/200305.mbox/%3cPAEOKILLLBAPHPPDDBNLGEGKEAAA.vic@outfitr.com%3e)
about possibility of arbitrary size page-sequence. Anyone know a fallow
up of this? There is a planned release of this very very very important fix?
Giorgio Mannelli@Eastway wrote:
> I have a quite big fo file generated programmatically in this way:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> <fo:layout-master-set>
> <fo:simple-page-master page-height="210mm" page-width="297mm"
> margin="10mm 2mm 2mm 2mm" master-name="PageMaster">
> <fo:region-before region-name="header" extent="15mm"
> display-align="before"/>
> <fo:region-body margin="10mm 3mm 3mm 3mm"/>
> </fo:simple-page-master>
> </fo:layout-master-set>
> <fo:page-sequence initial-page-number="1"
> master-reference="PageMaster">
> <fo:static-content flow-name="header">
> <fo:block font-size="8pt" text-align="center">
> something
> </fo:block>
> <fo:block font-size="8pt" text-align="center">
> Anno: 2005 / Pagina: <fo:page-number/>
> </fo:block>
> </fo:static-content>
> <fo:flow flow-name="xsl-region-body">
>
> lot's of things feeded via java trough a loop
>
> </fo:flow>
> </fo:page-sequence>
> </fo:root>
>
>
> I need to generate a PDF file of about 1500 - 2000 pages but I got
> OutOfMemory (even If I use a large amount (more than 350 Mb) of it).
>
> I red about use more than one page-sequence but I can't split it in
> pages by my own hands because I dunno after how many iterations The
> document reach the end of a page.
>
> thanks in advance, best regrds
> Giorgio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org