将附件嵌入到PDF

Contents
[ ]

在Excel中,您可以插入带有源数据的OLE对象(embedded-attachments-example.xlsx)。双击OLE对象,嵌入的文件将被打开。

通常,在转换为PDF时,OLE对象将呈现为图标或缩略图,而不包含OLE对象源数据。使用选项PdfSaveOptions.EmbedAttachments,您可以将OLE对象源数据嵌入到PDF中的附件中。您可以在PDF中双击图标或缩略图以打开OLE对象的源文件。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// Open the template file
Workbook wb = new Workbook("embedded-attachments-example.xlsx");
// Set to embed Ole Object attachment.
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.setEmbedAttachments(true);
// Save the pdf file with PdfSaveOptions
wb.save("output.pdf", pdfSaveOptions);

embedded-attachment.png