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 Jason Harrop <jh...@gmail.com> on 2014/05/20 03:15:43 UTC

preserving a trailing space in inline

Hi, in the following FO, I'm losing the space between the word "page"
and page-number-citation-last.

              <table-cell >

                <block>
                  <inline font-size="8.5pt">
                    <inline font-family="Calibri" >Page No:  </inline>
                  </inline>
                  <page-number font-size="10.0pt"/>
                  <inline font-size="10.0pt">
                    <inline font-family="Calibri" > </inline>
                    <inline font-family="Calibri" >of </inline>
                  </inline>
                  <page-number-citation-last font-size="10.0pt"
ref-id="section_s1"/>
                </block>
              </table-cell>

I've tried various permutations and combinations of
white-space-collapse, white-space-treatment, and even
white-space="pre", but to no avail.

Could someone please suggest what ought to work?

I'm using FOP 1.1.  Thanks .. Jason

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: preserving a trailing space in inline

Posted by Rob Sargent <rs...@xmission.com>.
This has worked for me

   <fo:block-container height="0.75in" overflow="hidden">
     <fo:block font-family="Optima" font-size="8pt" font-style="italic">
     <fo:inline font-weight="bold"><xsl:value-of 
select="concat('(Left)','&#160;')"/></fo:inline>
     <xsl:value-of select="//pages/page[1]/image[@pos=1]/caption/text()"/>
    </fo:block>
  </fo:block-container>

On 05/19/2014 09:25 PM, Terence M. Bandoian wrote:
> On 5/19/2014 10:03 PM, Jason Harrop wrote:
>> Hi Terence,  thanks, it's good to know the simple FO works fine!
>>
>> Its non trivial for me to get rid of the inline elements, although I
>> could get rid of the nested ones if it is these which are causing the
>> problem.
>>
>> I'll look into that, but it would still be useful to get confirmation
>> as to which of the whitespace attributes I should be using.
>>
>> thanks .. Jason
>
>
> Hi, Jason-
>
> Both fo:page-number and fo:page-number-citation-last are documented to 
> support padding so you might look into that if you can't determine why 
> the white space is collapsing.
>
> Good luck!
>
> -Terence Bandoian
>
> ---------------------------------------------------------------------
> 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: preserving a trailing space in inline

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
On 5/19/2014 10:03 PM, Jason Harrop wrote:
> Hi Terence,  thanks, it's good to know the simple FO works fine!
>
> Its non trivial for me to get rid of the inline elements, although I
> could get rid of the nested ones if it is these which are causing the
> problem.
>
> I'll look into that, but it would still be useful to get confirmation
> as to which of the whitespace attributes I should be using.
>
> thanks .. Jason


Hi, Jason-

Both fo:page-number and fo:page-number-citation-last are documented to 
support padding so you might look into that if you can't determine why 
the white space is collapsing.

Good luck!

-Terence Bandoian

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: preserving a trailing space in inline

Posted by Jason Harrop <jh...@gmail.com>.
HI Pascal

Thank you very much for taking the time to explore this issue;  I've
implemented your suggested workaround; it works nicely!

The JIRA entry: https://issues.apache.org/jira/browse/FOP-2374

thanks again .. Jason


On Tue, May 20, 2014 at 6:20 PM, Pascal Sancho <ps...@gmail.com> wrote:
> Hi,
>
> I've done further checks with your snippet.
>
> The behaviour is definitively an issue when a
> fo:page-number-citation-last (PNCL) comes after a fo:inline element
> and no content comes after the PNCL.
> Please, can you file in a bug entry in Jira, attaching short FO
> snippet (the one I've extended from yours is OK) plus PDF output.
>
> Fortunately, I've found a workaround:
> Just add a character AFTER the PNCL element other than a regular white space.
> The ZWSP (Zero Width SPace, AKA &#x200b;) will do the trick (see
> attached snippet).
>
>
> 2014-05-20 6:06 GMT+02:00 Jason Harrop <jh...@gmail.com>:
>> Ooops, sorry, the space is lost after "of", so I'm getting:
>>
>>      of<last page no>
>>
>> Thanks for pointing that out Manuel!
>>
>> cheers .. Jason
>>
>>
>> On Tue, May 20, 2014 at 1:56 PM, Manuel Mall <mm...@arcus.com.au> wrote:
>>> You other option might be to use a non breaking space (&#160;).
>>>
>>> Also your original description is a bit confusing as you said:
>>>
>>> " I'm losing the space between the word "page" and page-number-citation-last."
>>>
>>> According to your fo snippet there is no word "page" it looks more like
>>>
>>>         Page No: <current page no> of <last page no>
>>>
>>> So you should be able to clearly say where the 'space is lost'.
>>>
>>> Manuel
>>>
>>> -----Original Message-----
>>> From: Jason Harrop [mailto:jharrop@gmail.com]
>>> Sent: Tuesday, 20 May 2014 11:04 AM
>>> To: fop-users@xmlgraphics.apache.org
>>> Subject: Re: preserving a trailing space in inline
>>>
>>> Hi Terence,  thanks, it's good to know the simple FO works fine!
>>>
>>> Its non trivial for me to get rid of the inline elements, although I could get rid of the nested ones if it is these which are causing the problem.
>>>
>>> I'll look into that, but it would still be useful to get confirmation as to which of the whitespace attributes I should be using.
>>>
>>> thanks .. Jason
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>
>
>
> --
> pascal
>
>
> ---------------------------------------------------------------------
> 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: preserving a trailing space in inline

Posted by Pascal Sancho <ps...@gmail.com>.
Hi,

I've done further checks with your snippet.

The behaviour is definitively an issue when a
fo:page-number-citation-last (PNCL) comes after a fo:inline element
and no content comes after the PNCL.
Please, can you file in a bug entry in Jira, attaching short FO
snippet (the one I've extended from yours is OK) plus PDF output.

Fortunately, I've found a workaround:
Just add a character AFTER the PNCL element other than a regular white space.
The ZWSP (Zero Width SPace, AKA &#x200b;) will do the trick (see
attached snippet).


2014-05-20 6:06 GMT+02:00 Jason Harrop <jh...@gmail.com>:
> Ooops, sorry, the space is lost after "of", so I'm getting:
>
>      of<last page no>
>
> Thanks for pointing that out Manuel!
>
> cheers .. Jason
>
>
> On Tue, May 20, 2014 at 1:56 PM, Manuel Mall <mm...@arcus.com.au> wrote:
>> You other option might be to use a non breaking space (&#160;).
>>
>> Also your original description is a bit confusing as you said:
>>
>> " I'm losing the space between the word "page" and page-number-citation-last."
>>
>> According to your fo snippet there is no word "page" it looks more like
>>
>>         Page No: <current page no> of <last page no>
>>
>> So you should be able to clearly say where the 'space is lost'.
>>
>> Manuel
>>
>> -----Original Message-----
>> From: Jason Harrop [mailto:jharrop@gmail.com]
>> Sent: Tuesday, 20 May 2014 11:04 AM
>> To: fop-users@xmlgraphics.apache.org
>> Subject: Re: preserving a trailing space in inline
>>
>> Hi Terence,  thanks, it's good to know the simple FO works fine!
>>
>> Its non trivial for me to get rid of the inline elements, although I could get rid of the nested ones if it is these which are causing the problem.
>>
>> I'll look into that, but it would still be useful to get confirmation as to which of the whitespace attributes I should be using.
>>
>> thanks .. Jason
>>
>> ---------------------------------------------------------------------
>> 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
>



-- 
pascal

Re: preserving a trailing space in inline

Posted by Jason Harrop <jh...@gmail.com>.
Ooops, sorry, the space is lost after "of", so I'm getting:

     of<last page no>

Thanks for pointing that out Manuel!

cheers .. Jason


On Tue, May 20, 2014 at 1:56 PM, Manuel Mall <mm...@arcus.com.au> wrote:
> You other option might be to use a non breaking space (&#160;).
>
> Also your original description is a bit confusing as you said:
>
> " I'm losing the space between the word "page" and page-number-citation-last."
>
> According to your fo snippet there is no word "page" it looks more like
>
>         Page No: <current page no> of <last page no>
>
> So you should be able to clearly say where the 'space is lost'.
>
> Manuel
>
> -----Original Message-----
> From: Jason Harrop [mailto:jharrop@gmail.com]
> Sent: Tuesday, 20 May 2014 11:04 AM
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: preserving a trailing space in inline
>
> Hi Terence,  thanks, it's good to know the simple FO works fine!
>
> Its non trivial for me to get rid of the inline elements, although I could get rid of the nested ones if it is these which are causing the problem.
>
> I'll look into that, but it would still be useful to get confirmation as to which of the whitespace attributes I should be using.
>
> thanks .. Jason
>
> ---------------------------------------------------------------------
> 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: preserving a trailing space in inline

Posted by Manuel Mall <mm...@arcus.com.au>.
You other option might be to use a non breaking space (&#160;).

Also your original description is a bit confusing as you said: 

" I'm losing the space between the word "page" and page-number-citation-last."

According to your fo snippet there is no word "page" it looks more like

	Page No: <current page no> of <last page no>

So you should be able to clearly say where the 'space is lost'.

Manuel

-----Original Message-----
From: Jason Harrop [mailto:jharrop@gmail.com] 
Sent: Tuesday, 20 May 2014 11:04 AM
To: fop-users@xmlgraphics.apache.org
Subject: Re: preserving a trailing space in inline

Hi Terence,  thanks, it's good to know the simple FO works fine!

Its non trivial for me to get rid of the inline elements, although I could get rid of the nested ones if it is these which are causing the problem.

I'll look into that, but it would still be useful to get confirmation as to which of the whitespace attributes I should be using.

thanks .. Jason

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: preserving a trailing space in inline

Posted by Jason Harrop <jh...@gmail.com>.
Hi Terence,  thanks, it's good to know the simple FO works fine!

Its non trivial for me to get rid of the inline elements, although I
could get rid of the nested ones if it is these which are causing the
problem.

I'll look into that, but it would still be useful to get confirmation
as to which of the whitespace attributes I should be using.

thanks .. Jason

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: preserving a trailing space in inline

Posted by "Terence M. Bandoian" <te...@tmbsw.com>.
On 5/19/2014 8:15 PM, Jason Harrop wrote:
> Hi, in the following FO, I'm losing the space between the word "page"
> and page-number-citation-last.
>
>                <table-cell >
>
>                  <block>
>                    <inline font-size="8.5pt">
>                      <inline font-family="Calibri" >Page No:  </inline>
>                    </inline>
>                    <page-number font-size="10.0pt"/>
>                    <inline font-size="10.0pt">
>                      <inline font-family="Calibri" > </inline>
>                      <inline font-family="Calibri" >of </inline>
>                    </inline>
>                    <page-number-citation-last font-size="10.0pt"
> ref-id="section_s1"/>
>                  </block>
>                </table-cell>
>
> I've tried various permutations and combinations of
> white-space-collapse, white-space-treatment, and even
> white-space="pre", but to no avail.
>
> Could someone please suggest what ought to work?
>
> I'm using FOP 1.1.  Thanks .. Jason


Hi, Jason-

I did something very similar using FOP 1.0 to generate PDF files. The 
XSL-FO I used looked like this:

<fo:block>
     Page <fo:page-number /> of
     <fo:page-number-citation-last ref-id="pageSequence" />
</fo:block>

The biggest difference I see is that I didn't use any inline objects.

-Terence Bandoian

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org