Hello,

 

Does anyone know how to print an €-sign into a PDF, using the PDFBox-library?

I use the normal way of writing into a pdf with this code:

 

PDPage page = this.getPage(pagenr);

PDPageContentStream stream;

try {

      stream = new PDPageContentStream(this.document, page, true, false);

      stream.setFont(PDType1Font.HELVETICA, 10);

      stream.setNonStrokingColor(Color.black);

 

      stream.beginText();

      stream.moveTextPositionByAmount(5, 7);

      stream.drawString("€"); 

      stream.endText();

      stream.close();

}

catch(IOException e) {

      e.printStackTrace();

}

 

But then some other signs appears (look in the attachment).

This also happens when I use the Unicode “\u20AC” instead of “€”.

 

So, does anyone know how to do this?

 

Thanks a lot!

 

Richard van Heest

Prins Bernhardlaan 116

3241 TA  MIDDELHARNIS

Tel. 0187-482094

Mob. 06-51040247

E-mail  <mailto:[email protected]> [email protected]

 

<<image001.jpg>>

Reply via email to