PDFに添付を埋め込む

Contents
[ ]

Excelでは、Oleオブジェクト(embedded-attachments-example.xlsx)を挿入できます。Oleオブジェクトをダブルクリックすると、埋め込みファイルが開きます。

通常、PDFに変換するとき、OLEオブジェクトはアイコンまたはサムネイルとしてレンダリングされ、そのソースデータは表示されません。ただし、PdfSaveOptions.EmbedAttachmentsオプションを使用することで、OLEオブジェクトのソースデータを添付として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