xsl-list
[Top] [All Lists]

Re: [xsl] [XSL-FO] Linebreaks on a page break (linefeed-treatment)

2018-06-28 09:06:51
Hello Peter,

Unfortunately, I'm stuck with the FO.

The third-party program that generates the XML based on users' input (in forms) 
only accepts XSL files to output PDF and it works with FOP and who-know-what 
XSLT engine. The users don't have access to other programs but that one so I 
cannot bypass it.


That is always a problem, regardless of the PDF formatter in use: the 
specification says "one page" but the user has given >1 page of text.


What do you mean by that? Where in specifications of Apache FOP is it said that 
XML text() cannot be bigger than one page?
Because if there's no line break during page break, no issue occurs, i.e. if it 
is plain text without line break AT THE END OF PAGE, it can span as many pages 
as it wants.

Thank you anyway for your kind offer.
Best regards


-----Original Message-----
From: Peter Flynn <peter(_at_)silmaril(_dot_)ie> 
Sent: Thursday, June 28, 2018 11:06 AM
To: Mathias Leclercq <Mathias(_dot_)Leclercq(_at_)biion(_dot_)com>
Subject: Re: [xsl] [XSL-FO] Linebreaks on a page break (linefeed-treatment)

On 28/06/18 07:33, Mathias Leclercq mathias(_dot_)leclercq(_at_)biion(_dot_)com 
wrote:
Hi everyone,

I'm using XSL-T and XSL-FO to produce PDF (A4) reports using data from 
forms filled by user in a third-party software (that output XML). 
Users can have any sorts of input, included large text area they can 
fill as they want (no control over the content size).

Have you looked at using XSLT wth LaTeX instead of FO? This will also generate 
PDF, and it provides better programmable access to the formatting.

The issue I came across is that whenever the text area is filled with 
enough data to cause a page break, and when there are linebreaks at 
the exact moment the page break occurs, the FOP processor issues a 
null pointer exception. Below is the part of the XSL-FO that is 
causing an issue.

LaTeX discards unwanted or unusable vertical white-space if it occurs at a 
page-break, so this problem does not occur.

The linefeed-treatment="preserve" is to keep the format from the form 
to the PDF and the keep-together.within-page="always" ("auto"
here to show the issue) is a workaround I found to resolve this issue 
but that I cannot keep because data is lost when the text span more 
than 1 page.

That is always a problem, regardless of the PDF formatter in use: the 
specification says "one page" but the user has given >1 page of text.

Is there a problem somewhere in my code? is it related to the FOP processor? 
I will leave this to the FO experts to answer.

If you would like us to look at a solution using LaTeX we would be happy to do 
a test free of charge.

///Peter Flynn
--
Peter Flynn | Principal Consultant | Silmaril Consultants | Cork 🇮🇪
Ireland | ☎ +353 86 824 5333 | ✉ peter(_at_)silmaril(_dot_)ie | 🌍
blogs.silmaril.ie/peter

--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>