Unicode in annotations

Help
Yan Wong
2013-02-25
2013-03-03
  • Yan Wong

    Yan Wong - 2013-02-25

    I've been trying to put unicode text into an annotation, by doing

    String mytext="Somé Unicode text"
    org.pdfclown.documents.interaction.annotations.Polygon polygon =
    new org.pdfclown.documents.interaction.annotations.Polygon(
    page,
    new Rectangle.Double(10.0,10.0,100.0,100.0),
    mytext);

    But I get:

    Exception in thread "main" java.lang.NullPointerException
    at org.pdfclown.tokens.PdfDocEncoding$1.getKey(PdfDocEncoding.java:84)
    at org.pdfclown.tokens.PdfDocEncoding$1.getKey(PdfDocEncoding.java:1)
    at org.pdfclown.tokens.LatinEncoding.encode(LatinEncoding.java:77)
    at org.pdfclown.objects.PdfTextString.setValue(PdfTextString.java:145)
    at org.pdfclown.objects.PdfString.<init>(PdfString.java:109)
    at org.pdfclown.objects.PdfTextString.<init>(PdfTextString.java:82)
    at org.pdfclown.objects.PdfTextString.get(PdfTextString.java:63)
    at org.pdfclown.documents.interaction.annotations.Annotation.setText(Annotation.java:537)

    Do I need to set the encoding of the document, or anything like that?

     
  • Stefano Chizzolini

    Hi Yan,
    it was caused by a subtle syntactic problem; it's been fixed by rev 102 [1].

    thank you!
    Stefano

    [1] https://sourceforge.net/p/clown/code/102/

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks