Hey,

I've tried to build a document with the "€"-sign.

contentStream.drawString("Hallo € Euro");

Unfortunately the generated document has not the expected sign.

þÿ􀀀H􀀀a􀀀l􀀀l􀀀o􀀀 ¬􀀀 􀀀E􀀀u􀀀r􀀀o

Therefore I took a look at the source Code. It was quite difficult und i rewrote the drawString-Method. No I can generate documents with €-sign in it.

Maybe someone is interessted in it. Perhaps someone could use ist.

private static final int SPACE = 32;
private static final int HEX_STRING_OPEN = 60;
private static final int HEX_STRING_CLOSE = 62;
private static final String SHOW_TEXT = "Tj\n";



public void drawString(String text) throws IOException {

ByteArrayOutputStream output = new ByteArrayOutputStream();
output.write(HEX_STRING_OPEN);
String s = "" + new java.math.BigInteger(1, text.getBytes("Windows-1252")).toString(16);
output.write(s.getBytes());
output.write(HEX_STRING_CLOSE);
appendRawCommands(output.toByteArray());
appendRawCommands(SPACE);
appendRawCommands(SHOW_TEXT);
}

Kind regards

Tobias

Reply via email to