PDFに添付ファイルを埋め込む

Contents
[ ]

Excelでは、元のデータを持つOleオブジェクトを挿入できます(embedded-attachments-example.xlsx)。Oleオブジェクトをダブルクリックすると、埋め込まれたファイルが開かれます。

一般的に、PDFに変換する際に、Oleオブジェクトはアイコンまたはサムネイルとしてレンダリングされ、Oleオブジェクトの元のデータは表示されません。PdfSaveOptions.EmbedAttachmentsオプションを使用すると、PDF内にOleオブジェクトの元のデータを添付ファイルとして埋め込むことができます。PDF内のアイコンやサムネイルをダブルクリックして、Oleオブジェクトの元のファイルを開くことができます。

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

embedded-attachment.png