Hello !

I use iText XMLWorkerHelper class for simply convert from HTML to PDF.

And I found a problem and sold.

When I convert Html inputStream with CSS InputStream, XMLWorkerHelper
doesn`t know font-faimly name in Korean. *Because Korean Charset use
2bytes.*

So I try to extend XMLWorkerHelper, but XMLWorkerHelper is Singleton and
have private Constructor. I CAN NOT Extend.

Finally I write new java file, copy and paste. modify method.

And I send to you modified part.

===================================================
.......................................

*public static synchronized CssFile getCSS(InputStream in) {*
        CssFile cssFile = null;
        if (null != in) {
            final CssFileProcessor cssFileProcessor = new
CssFileProcessor();

           * BufferedReader br = new BufferedReader(new
InputStreamReader(in));*

            try {
            *String l = "";*
*                while (null != (l = br.readLine())) {*
*                int charLen = l.length();*
*                for(int i = 0 ; i < charLen ; i++) {*
*                cssFileProcessor.process(l.charAt(i));*
*                }*
*                }*
                cssFile = new CSSFileWrapper(cssFileProcessor.getCss(),
true);
            } catch (final IOException e) {
                throw new RuntimeWorkerException(e);
            } finally {
                try {
                    in.close();
                } catch (final IOException e) {
                    throw new RuntimeWorkerException(e);
                }
            }
        }

return cssFile;
}
............................................
=======================================================

Thank you, iText help me a lot! And I hope this source code help you.
Bye.
------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to