Needs help to improve docx/odt converter to pdf with iText font problem

232 views
Skip to first unread message

Angelo zerr

unread,
Jun 4, 2013, 3:09:27 AM6/4/13
to xdocr...@googlegroups.com
Hi XDocReport users,

Since 2 days, I'm trying to manage bullet for docx->pdf converter and I have problem with encoding. When I create font as embedded, it works.

I don't know how to manage font with generic mean (to support for instance bullet which uses Symbol font).

There is too a problem with chineese characters and I don't know how to fix that. I'm searching someone who could help me to fix those iText font problems.

Many thank's for your help.

Regards Angelo

les...@safe-mail.net

unread,
Jun 4, 2013, 7:57:30 AM6/4/13
to xdocr...@googlegroups.com

Angelo

Try to set font encoding to unicode in PdfOptions

In odf->pdf converter we have:

this.fontEncoding = BaseFont.IDENTITY_H;

but in docx->pdf converter we have:

this.fontEncoding = ITextFontRegistry.getRegistry().getSystemEncoding();

Try to change this fragment and see result. I think it should help, because there is no problem with bullet symbols in odf->pdf converter. Don't know if it works with chinese characters too.

Regards

Leszek

--
You received this message because you are subscribed to the Google Groups "xdocreport" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xdocreport+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Angelo zerr

unread,
Jun 4, 2013, 8:59:43 AM6/4/13
to xdocr...@googlegroups.com
Hi Leszek,

Many thank's for your answer.

I'm very glad that you come back, that's really cool!
I had tried to use BaseFont.IDENTITY_H but it faild with docx. The reason is that the bullet uses Symbol font for docx.
With odt you have the same problem if you try to convert an odt with symbol font it throws throws "java.io.UnsupportedEncodingException: Identity-H"

In the commit https://code.google.com/p/xdocreport/source/detail?r=038b282dcd887306a50fa0a40f17e0a46b15c7ec you will see that I have added JUnit for issue 203 and 247. You must remove @Ignore annotation to launch the test.

I'm searching how to use Symbol Font with iText.

Regards Angelo

Angelo zerr

unread,
Jun 4, 2013, 10:01:12 AM6/4/13
to xdocr...@googlegroups.com
Leszek,

I have fixed the use of Symbol+Windings font with odt and docx by creating a new ITextFontRegistry2 (name is very bad, so we could discuss together to change it).

The basic idea is that I create a new font family and I set it as embedded. 

Tell me if you are any questions and if you like it. By default XDocReport uses ITextFontRegistry (so there are problem with Symbol Font). To resolve uses of Symbol font, ITextFontRegistry2 should be used.
It works with my OS Windows, don't know if it works with other OS.

Regards Angelo


2013/6/4 Angelo zerr <angel...@gmail.com>
Reply all
Reply to author
Forward
0 new messages