//Some lines of code here
//file embedding
PdfFileSpecification fs =PdfFileSpecification.fileEmbedded(writer, new File("").getAbsolutePath(), new File("").getName(), null);
//atachment
writer.addFileAttachment(file.getName().substring(0,file.getName().indexOf('.')), fs);
//Getting embedded file
PdfAction action = PdfAction.gotoEmbedded(null, target, dest, true);//dest
嵌入在pdf中的** html没有使用PdfAction.gotoEmbedded 打开