作为Android的初学者,我很难将html转换为pdf,每次将html转换为pdf时,pdf文件中的结果图像都很小。我怎么解决这个问题?这个代码我用来转换html:
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(file));
document.open();
InputStream htmlPath = getAssets().open(filename + ".html");
XMLWorkerHelper helper = XMLWorkerHelper.getInstance();
helper.parseXHtml(writer, document, htmlPath);
document.close();
writer.close();
这是结果: