I need to write letters with diacritics to PDF using PDFBox.
PDDocument document = new PDDocument();
PDPage page = new PDPage();
document.addPage(page);
PDPageContentStream contentStream = new PDPageContentStream(document, page);
PDType1Font font = PDType1Font.HELVETICA;
contentStream.setFont(font, 12);
contentStream.beginText();
contentStream.moveTextPositionByAmount(100, 400);
contentStream.drawString("čćšž");
contentStream.endText();
contentStream.close();
document.save("document.pdf");
document.close();
But instead of getting "čćšž" I'm getting garbage in document.
My research didin't get me anywhere. Solution 1 doesn't work, and Solution 2 says it is not possible to load right encoding. Is it really true?