I am trying the following
itextg 5.5.3 jar
xmlworker 5.5.3 jar
test.html
<html xmlns="http://www.w3.org/1999/xhtml" lang="cs">
<head>
</head>
<body>
Test: ěščřžýáíé Ň ň ě Ě
<div style="font-family: 'Times New Roman',font-weight: bold,backround-color blue;">
Test: ěščřžýáíé Ň ň ě Ě
</div>
</body>
</html>
ConvertHTMLToPDF.java
public class ConvertHTMLToPDF {
public static final String RESULT = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Notes/test.pdf";
public static final String RESORCE = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Notes/html/test.html";
void convertHTMLToPDF() throws IOException, DocumentException {
Rectangle pagesize = new Rectangle(415,1750);
Document document = new Document(pagesize);
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(RESULT));
document.open();
XMLWorkerHelper.getInstance().parseXHtml(writer, document, new FileInputStream(RESORCE));
document.close();
System.out.println( "PDF Created!" );
}
}
Output test.pdf
Test: šžýáíé
Test: šžýáíé
How to get test.pdf
Test: ěščřžýáíé Ň ň ě Ě
Test: ěščřžýáíé Ň ň ě Ě