pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From HK Kim <julian.hk....@gmail.com>
Subject Question about writing string to PDF with Slavic language.
Date Fri, 01 Nov 2013 15:42:27 GMT
Hi,

I'm having trouble figuring out how to get Slavic language writing working;
input I'm trying is:

przesyłkiąęćktórże

            PDSimpleFont font = PDType1Font.HELVETICA;

            font.setFontEncoding(new PdfDocEncoding());

            // PDSimpleFont font = PDTrueTypeFont.loadTTF(pdfDocument,
newByteArrayInputStream(
mFontBytes)); // tried importing multiple ttfs with no success

            PDPageContentStream stream =
newPDPageContentStream(pdfDocument, widget.getPage(),
true, true);

            stream.beginText();

            stream.setFont(font, 10);

            stream.moveTextPositionByAmount(lowerX, lowerY);

            if (rotate)

            {

                stream.setTextRotation(sNinetyDegreesInRadian, lowerX,
lowerY);

            }

            stream.drawString(value);

            stream.endText();

            stream.close();

It always comes out broken, or with gentium R102 ttf, it isn't broken but
it comes out completely wrong.


put it this way - if you had to write "przesyłkiąęćktórże" onto a pdf as a
text at a random location on PDF, how would you go about it?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message