1
votes

I'm trying to display correctly a footnote inside a PDF with Apache FOP.

<fo:block text-align="right">
    <fo:bidi-override unicode-bidi="embed" direction="rtl">
        <fo:inline>שלום</fo:inline>
        <fo:footnote>
            <fo:inline alignment-baseline="hanging">1</fo:inline>
            <fo:footnote-body>
                <fo:block>
                    <fo:bidi-override unicode-bidi="embed" direction="rtl">
                        <fo:inline>שלום</fo:inline>
                    </fo:bidi-override>
                </fo:block>
            </fo:footnote-body>
        </fo:footnote>
        <fo:inline>.</fo:inline>
    </fo:bidi-override>
</fo:block>

For some reason, the footnote text (at the bottom of the page) appears reverted:

enter image description here

Not sure what I'm doing wrong...

1
FWIW, I tried your FO with AH Formatter, and the footnote text came out in the reverse order from what you show. So it looks like this could be a FOP bug. Also FWIW, the fo:inline in your sample is redundant. - Tony Graham
Thanks! I created an issue. In the meantime, is there a way to mimic the footnote without using XSL-FO <footnote>? Like having the text appear in the footer? - manash

1 Answers

0
votes
  1. (bad) Solution approach: remove (the inner) direction="rtl" attribute, but this will probably "break other things".
  2. (better) approach (but maybe not readable/funny in your language, sry, when):

    <fo:inline>םולש</fo:inline>
    

..but most confusion (for me & maybe "the engine") raise the nested <fo:bidi-override/> elements...

  1. approach 'd be:

    <fo:block text-align="right">
      <fo:bidi-override unicode-bidi="embed" direction="rtl">
        <fo:inline>שלום</fo:inline>
      </fo:bidi-override>
      <fo:footnote>
        <fo:inline alignment-baseline="hanging">1</fo:inline>
        <fo:footnote-body>
          <fo:block>
            <fo:bidi-override unicode-bidi="embed" direction="rtl">
              <fo:inline>שלום</fo:inline>
            </fo:bidi-override>
          </fo:block>
        </fo:footnote-body>
      </fo:footnote>
      <fo:inline>.</fo:inline>
    </fo:block>
    

(re-arrange the outer <fo:bidi-override/>.)