Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Flying Saucer and utf encoding

807591Jun 6 2008 — edited Jun 8 2008
Hello,

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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 6 2008
Added on Jun 6 2008
6 comments
2,883 views