我正在将html数据转换为pdf,但是我得到了一些空白,其中会插入一些大数据,我想要删除空白以便跟踪数据
注意:标题来自jasper报告
'Document document = new Document(PageSize.A4, 40, 72, getMargins(1),20);`
document.setMarginMirroringTopBottom(true);`
String path = dao.gettomcatserverPath1() + "webapps/wordimages/disch" +patid+ ".pdf";`
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(path));
`String html = "";
List list1 = dao.executeQuery("select wordole from ip.dischargetemplate where patid='"+patid+"'");
html = ((Map)list1.get(0)).get("WORDOLE").toString();
InputStream _ishtml = new ByteArrayInputStream(html.getBytes());
HeaderFooter event = new HeaderFooter();`
writer.setPageEvent(event);`
writer.setBoxSize("art", new Rectangle(36, 54, 559, 788));`
document.open();`
Font font = FontFactory.getFont("Times-Roman");
XMLWorkerHelper.getInstance().parseXHtml(writer, document, _ishtml);`
document.close();`