小编Kur*_*Tt-的帖子

通过iText和XMLWorker将波兰语字母转换为PDF

我有一个带有示例的字符串 - 它的效果非常好,但是当我添加波兰字母时,它们就消失了.我试过这样的事情:

        byte[] byteArray = str.getBytes(Charset.forName("UTF-8"));
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArray);
        worker.parseXHtml(pdfWriter, document, byteArrayInputStream, Charset.forName("UTF-8"));
Run Code Online (Sandbox Code Playgroud)

但它没有改变任何东西.如何添加波兰字母?

编辑:它仍然无法正常工作.

码:

        document.open();

        XMLWorkerHelper worker = XMLWorkerHelper.getInstance();
        String str = "<html><head></head><body style=\"font-size:12.0pt; font-family:Times New Roman\">"+
                "<a href='http://www.rgagnon.com/howto.html'><b>Real's HowTo</b></a>" +
                "<h1>Show your support</h1>" +
                "<p>It DOES cost a lot to produce this site - in ISP storage and transfer fees</p>" +
                "<p>TEST POLSKICH ZNAKÓW: ???CÓó????????</p>" +
                "<hr/>" +
                "<p>the huge amounts of time it takes for one person to design and write the actual …
Run Code Online (Sandbox Code Playgroud)

java itext xmlworker

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

itext ×1

java ×1

xmlworker ×1