0

i want to create an arabic pdf, but i have this problem:

my code:

FontProvider fontProvider = new DefaultFontProvider(false, false, false);

fontProvider.addFont("/police/Amiri-bold.ttf");
ConverterProperties converterProperties = new ConverterProperties();
converterProperties.setFontProvider(fontProvider);

converterProperties.setBaseUri("http://localhost:8080");
HtmlConverter.convertToPdf(cpar, pdfDoc, converterProperties);
pdfDoc.close();

i use itext7 v7.2.5 and html2pdf v4.0.5

the result must be like that:

I tried to use pdfcalligraph but it's not free!

1
  • "I tried to use pdfcalligraph but it's not free!" - It may not be free but without it iText does not offer support for scripts like Arabic. Well, of course you can try and add a similar functionality to iText. There is a library ICU4J which might be helpful for that but I've never had the need to try and use it.
    – mkl
    Commented May 6 at 15:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.