You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by András Wirth <ag...@gmail.com> on 2015/08/08 10:00:47 UTC

PDFBox National Charachters

Dear Developers,

I have a question about the PDFbox.
I am a little bit frustrated, because I used the pdfbox to generate a PDF
document, but I can't display the Hungarian "ő" and "Ő" characters.
Actually I used the pdfbox1.8.10.

I read might this problem fixed, but I am not sure how to get this fixed
code to my workspace.

This is little bit important, because I would like to generate sitting
cards to my marriage party. :)
And we have three participants who have this charachter in they name.

Can somebody help me?

Bests,
Andras from Hungary

Re: PDFBox National Charachters

Posted by Tilman Hausherr <TH...@t-online.de>.
Hi,

This doesn't work with PDFBox 1.8. However it works for the unreleased 
2.0 version:
https://pdfbox.apache.org/downloads.html#scm
https://pdfbox.apache.org/2.0/getting-started.html

and here's an example from the source code:

public class EmbeddedFonts
{
     public static void main(String[] args) throws IOException
     {
         PDDocument document = new PDDocument();
         PDPage page = new PDPage(PDRectangle.A4);
         document.addPage(page);

         String dir = 
"../pdfbox/src/main/resources/org/apache/pdfbox/resources/ttf/";
         PDType0Font font = PDType0Font.load(document, new File(dir + 
"LiberationSans-Regular.ttf"));

         PDPageContentStream stream = new PDPageContentStream(document, 
page);

         stream.beginText();
         stream.setFont(font, 12);
         stream.setLeading(12 * 1.2);

         stream.newLineAtOffset(50, 600);
         stream.showText("PDFBox's Unicode with Embedded TrueType Font");
         stream.newLine();

         stream.showText("Supports full Unicode text ☺");
         stream.newLine();

         stream.showText("English русский язык Tiếng Việt");

         stream.endText();
         stream.close();

         document.save("example.pdf");
         document.close();
     }
}



Tilman

Am 08.08.2015 um 10:00 schrieb András Wirth:
> Dear Developers,
>
> I have a question about the PDFbox.
> I am a little bit frustrated, because I used the pdfbox to generate a PDF
> document, but I can't display the Hungarian "ő" and "Ő" characters.
> Actually I used the pdfbox1.8.10.
>
> I read might this problem fixed, but I am not sure how to get this fixed
> code to my workspace.
>
> This is little bit important, because I would like to generate sitting
> cards to my marriage party. :)
> And we have three participants who have this charachter in they name.
>
> Can somebody help me?
>
> Bests,
> Andras from Hungary
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org