I am using Flying Saucer to generate PDF in my project for long time already. My documents have header and footer repeated on each page. Everything is working fine.
Now I got a requirement to add support of arabic texts in the documents. I embedded the font with Arabic characters and implemented RTLTextReplacedElementFactory (copied from flying saucer support group). Arabic text is displayed OK while it is in a page. If arabic text is inside of the footer, then it is positioned incorrectly:
The footer is created using the following CSS:
@page {
@bottom-left {
content: element(footer);
vertical-align: top;
border-top: 1px solid black;
}
size: A4 portrait;
margin: 2cm;
}
html,
body {
font-family: 'Roboto', sans-serif;
font-size: 12pt;
}
.arabic {
font-family: "Noto Sans Arabic", sans-serif;
font-size: 10pt;
font-style: normal;
font-weight: 100;
}
div#footer {
display: block;
position: running(footer);
}
I do not understand why the arabic text is incorrectly positioned and I do not understand where to start debugging (also, if it possible to have arabic texts in the running footer at all).
The example project is here https://github.com/igorbljahhin/flying-saucer-issue-with-arabic-in-footer.
The issue is reproduced with iText5 and with OpenPDF.
