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 "ngo.thanh.hien" <ng...@vietsoftware.com> on 2004/05/11 11:03:53 UTC
Fit data into a PDF page
Dear FOP experts
I used FOP to transform report data from XSL-FO to PDF.
My purpose is have a report that fit into a PDF page (A4) but the report data
couldn't fit into a page if have more data. Could you have any solution for
this fitting in any scope of report data? Will I modify XSL-FO or this
fitting is role of display PDF software (Adobe Reader for example)?
Thanks & best regards
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
CSS to XSL FO?
Posted by "Robert C. Leif" <rl...@rleif.com>.
Is there any tool to convert a cascading style sheet (CSS) to XSL FO?
Thank you.
Bob Leif
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
RE: Fit data into a PDF page
Posted by Chris Pratt <ch...@planetpratt.com>.
One way that FOP could help in situations like this, without hacking or
extending the XSL-FO Spec, might be to allow registration of event callback
handlers for specific events with the Driver. The idea, at least in this
case, would be to register a PaginationHandler that would be called whenever
FOP determined that a new page was necessary. In this users case he could
abort the current Formatting process, decrement some point size parameter
and try again until he got a document without an intervening
PaginationHandler event. This type of event based processing could probably
be useful in many other contexts, but seems well suited for this one.
(*Chris*)
-----Original Message-----
From: Clay Leeds [mailto:cleeds@medata.com]
Sent: Tuesday, May 11, 2004 7:55 am
To: fop-user@xml.apache.org
Subject: Re: Fit data into a PDF page
Chris Bowditch wrote:
> I think what you are asking for is something like scale-to-fit? There is
> no such feature in XSL-FO I'm afraid. The only way to achieve this
> effect would be to change your font size/spacing depending on how much
> data is in the report. Exactly how to do this will depend on the details
> of your reports. Some experimentation will be required, and I should
> warn you that such a solution will not be particularly robust, i.e.
> report will be unreadable if you try to squeeze 6 pages worth into 1 page.
>
> Chris
To echo what Chris says, the solution you will find will probably not be
very desirable. You could also (perhaps) try post-processing with iText,
although I'm not certain how it would work.
I was going to suggest one other possibility: calculate dynamically
sized region-before/region-body/region-after margins & extents. This
would enable you to make the 'HEADER' and/or 'FOOTER' portions
'shrink-to-fit' depending upon the amount of content.
However, if you're only creating one page, you're probably only using
region-body anyway...
Good luck! And please let us know what you come up with so it's in the
archives!
Web Maestro Clay
FOP Committer (got confirmation yesterday! :-D)
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: Fit data into a PDF page
Posted by Clay Leeds <cl...@medata.com>.
Chris Bowditch wrote:
> I think what you are asking for is something like scale-to-fit? There is
> no such feature in XSL-FO I'm afraid. The only way to achieve this
> effect would be to change your font size/spacing depending on how much
> data is in the report. Exactly how to do this will depend on the details
> of your reports. Some experimentation will be required, and I should
> warn you that such a solution will not be particularly robust, i.e.
> report will be unreadable if you try to squeeze 6 pages worth into 1 page.
>
> Chris
To echo what Chris says, the solution you will find will probably not be
very desirable. You could also (perhaps) try post-processing with iText,
although I'm not certain how it would work.
I was going to suggest one other possibility: calculate dynamically
sized region-before/region-body/region-after margins & extents. This
would enable you to make the 'HEADER' and/or 'FOOTER' portions
'shrink-to-fit' depending upon the amount of content.
However, if you're only creating one page, you're probably only using
region-body anyway...
Good luck! And please let us know what you come up with so it's in the
archives!
Web Maestro Clay
FOP Committer (got confirmation yesterday! :-D)
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org
Re: Fit data into a PDF page
Posted by Chris Bowditch <bo...@hotmail.com>.
ngo.thanh.hien wrote:
> Dear FOP experts
> I used FOP to transform report data from XSL-FO to PDF.
> My purpose is have a report that fit into a PDF page (A4) but the report data
> couldn't fit into a page if have more data. Could you have any solution for
> this fitting in any scope of report data? Will I modify XSL-FO or this
> fitting is role of display PDF software (Adobe Reader for example)?
I think what you are asking for is something like scale-to-fit? There is no
such feature in XSL-FO I'm afraid. The only way to achieve this effect would
be to change your font size/spacing depending on how much data is in the
report. Exactly how to do this will depend on the details of your reports.
Some experimentation will be required, and I should warn you that such a
solution will not be particularly robust, i.e. report will be unreadable if
you try to squeeze 6 pages worth into 1 page.
Chris
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org