Flying Saucer and utf encoding
807591Jun 6 2008 — edited Jun 8 2008Hello,
This post is on the heals of a former post of another user.
http://forum.java.sun.com/thread.jspa?threadID=5265104&messageID=10105301
I am using Flying Saucer in a J2EE application. The server is configured to encode using UTF-8. I required to keep this setting. I would like to know if there is a way to change the default character encoding from latin to UTF-8. It seem like there should be a method to set the encoding.
I am aware of this instruction on https://xhtmlrenderer.dev.java.net/r7/users-guide-r7.html#configuration
import com.lowagie.text.pdf.BaseFont;
ITextRenderer renderer = new ITextRenderer();
FontResolver resolver = renderer.getFontResolver();
resolver.addFont (
"C:\\WINNT\\Fonts\\ARIALUNI.TTF",
BaseFont.IDENTITY_H,
BaseFont.NOT_EMBEDDED
);
However,
This does not work for me because the instantiation of the ITextRenderer object is what gives me runtime exceptions.
I commented everything out left this line ITextRenderer renderer = new ITextRenderer(); and I still get runtime exceptions.
Any help would be greatly appreciated,
Thanks.