Witam
Staram się wygenerować pdf z polskimi znakami. PDF zawiera tabele.
W każdym miejscu oprócz zawartości tabeli są polskie znaki, niestety w tabeli nie są one wyświetlane. Przykładowo : Węgry --> Wgry.
Czy ktoś spotkał się z takim problemem ?
Domyślam się ,że to przez to ,że nie mogę ustawić czcionki dla elementu. Ale nawet jeśli na podstawie elementu stworzylem paragraph i ustawiłem odpowiedni font to nie pomogło.
Tak jakby font nie działa dla tego co jest w znacznikach
public static void replaceContent(Document doc, Font fontContent, String contentReplaced) throws IOException, DocumentException {
if (contentReplaced.contains("<TABLE")) {
String text = "<html><head>" + "<meta http-equiv='Content-Type' content='text/html; charset='utf-8'/>"
+ "</head><body>" + contentReplaced + "</body></html>";
StyleSheet ss = UtilsPdf.setStyleSheetForPdf();
StringReader reader = new StringReader(text);
@SuppressWarnings("unchecked")
List<Element> elementList = HTMLWorker.parseToList(reader, ss);
for (Element element : elementList) {
if(element instanceof Paragraph){
Paragraph paragraph = new Paragraph();
paragraph.setFont(fontContent);
paragraph.setIndentationLeft(35f);
paragraph.setIndentationRight(35f);
paragraph.add(element);
doc.add(paragraph);
}else