You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Ramin Firoozye <ra...@wizen.com> on 2000/12/04 21:49:48 UTC
RE: Page Breaks
Hi Jim,
Sounds like a text-replace is called for. A few questions:
- Do you have the opportunity to pre-process the goods via Java/sed/perl or
something like that? That would be the easiest way to do a text replace
before you even get to the XSLT processor.
- You might need to tweak the XML encoding to be able to handle the ASCII
form-feed character un-escaped. Depends on the parser you're using.
- If your environment allows it you can also invoke XSLT extension functions
to do the replacement.
- Have you thought of trying the contains(), substring-before() and
substring-after() functions recursively to try to locate and extract the
text surrounding the form-feed character? It won't be pretty but if you
*must* stay in XSLT, it's pretty much your only choice.
Just some ideas...
Ramin
>
> How would I code my XSL to scan a text element for form feeds and insert a
> "<fo:block break-before="page">" and the corresponding
> "</fo:block>" at the
> correct places?
>
> Jim
>
> -----Original Message-----
> From: Vladimir Sneblic [mailto:vladimir.sneblic@sytec.co.nz]
> Sent: Monday, December 03, 2001 4:13 PM
> To: 'fop-dev@xml.apache.org'
> Subject: RE: Page Breaks
>
>
> Try using break-before="page" property of fo:block something like:
>
> <fo:block break-before="page"> The text to appear on the next
> page</fo:block>
>
> I think you can leave it empty (i.e. a block with no content), and use it
> purely as a page break mechanism.
>
> Have fun,
>
> Vlad
>
>
>
> -----Original Message-----
> From: Jim Urban [mailto:jim.urban@netsteps.net]
> Sent: Tuesday, 4 December 2001 11:07 a.m.
> To: FOP Dev
> Subject: Page Breaks
>
> I have a servlet which dynamically generates XML which is
> then translated into FO and ran through FOP to generate PDFs. What can I
> embed (like a "\f") in the XML text that will cause FOP to automatically
> start a new page?
>
> Thanks,
>
> Jim Urban
> Product Manager
> Netsteps Inc.
> Suite 505E
> 1 Pierce Pl.
> Itasca, IL 60143
> Voice: (630) 250-3045 x2164
> Fax: (630) 250-3046
> << File: ATT70001.txt >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
RE: Page Breaks
Posted by Jim Urban <ji...@netsteps.net>.
-----Original Message-----
From: Ramin Firoozye [mailto:ramin@wizen.com]
Sent: Monday, December 04, 2000 2:50 PM
To: fop-dev@xml.apache.org
Subject: RE: Page Breaks
Hi Jim,
Sounds like a text-replace is called for. A few questions:
- Do you have the opportunity to pre-process the goods via Java/sed/perl or
something like that? That would be the easiest way to do a text replace
before you even get to the XSLT processor.
No. The text must be untouched by everything but XSLT.
- You might need to tweak the XML encoding to be able to handle the ASCII
form-feed character un-escaped. Depends on the parser you're using.
Using Xalan. Xalan says unicode 12 (decimal for form feed) is invalid.
- If your environment allows it you can also invoke XSLT extension functions
to do the replacement.
The clients don't want any non-standard (extension) translation functions.
- Have you thought of trying the contains(), substring-before() and
substring-after() functions recursively to try to locate and extract the
text surrounding the form-feed character? It won't be pretty but if you
*must* stay in XSLT, it's pretty much your only choice.
Yeah, that is ugly.
Just some ideas...
Thanks, for the ideas. I am currently working with our DBA to see if we can
store the contents of each page in a seperate table row. That way we can
use "xsl:for-each" to print each row in a seperate fo:block with a
break-after option.
Ramin
>
> How would I code my XSL to scan a text element for form feeds and insert a
> "<fo:block break-before="page">" and the corresponding
> "</fo:block>" at the
> correct places?
>
> Jim
>
> -----Original Message-----
> From: Vladimir Sneblic [mailto:vladimir.sneblic@sytec.co.nz]
> Sent: Monday, December 03, 2001 4:13 PM
> To: 'fop-dev@xml.apache.org'
> Subject: RE: Page Breaks
>
>
> Try using break-before="page" property of fo:block something like:
>
> <fo:block break-before="page"> The text to appear on the next
> page</fo:block>
>
> I think you can leave it empty (i.e. a block with no content), and use it
> purely as a page break mechanism.
>
> Have fun,
>
> Vlad
>
>
>
> -----Original Message-----
> From: Jim Urban [mailto:jim.urban@netsteps.net]
> Sent: Tuesday, 4 December 2001 11:07 a.m.
> To: FOP Dev
> Subject: Page Breaks
>
> I have a servlet which dynamically generates XML which is
> then translated into FO and ran through FOP to generate PDFs. What can I
> embed (like a "\f") in the XML text that will cause FOP to automatically
> start a new page?
>
> Thanks,
>
> Jim Urban
> Product Manager
> Netsteps Inc.
> Suite 505E
> 1 Pierce Pl.
> Itasca, IL 60143
> Voice: (630) 250-3045 x2164
> Fax: (630) 250-3046
> << File: ATT70001.txt >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org