我需要将合并后的PDF保存在硬盘上,然后将其加载为最终PDF
下面是我的代码(在IPAD上使用Safri,PDF alwasy是空的)
PdfReader reader = new PdfReader(folder + fileName);
PdfStamper stamper = new PdfStamper( reader, out, '\0', true );
AcroFields fields = stamper.getAcroFields();
String fdfContent = (String) request.getAttribute("fdfContent");
FdfReader fdfReader = new FdfReader(fdfContent.getBytes());
fields.setFields(fdfReader);
out.flush();
stamper.close();
reader.close();
非常感谢
答案 0 :(得分:1)
使用
PdfStamper stamper = new PdfStamper( reader, out, '\0', false );
stamper.setFormFlattening(true);