PDFに添付ファイルを埋め込む
Contents
[
Hide
]
Excelでは、元のデータを持つOleオブジェクトを挿入できます(embedded-attachments-example.xlsx)。Oleオブジェクトをダブルクリックすると、埋め込まれたファイルが開かれます。
一般的に、PDFに変換する際に、Oleオブジェクトはアイコンまたはサムネイルとしてレンダリングされ、Oleオブジェクトの元のデータは表示されません。PdfSaveOptions.EmbedAttachmentsオプションを使用すると、PDF内にOleオブジェクトの元のデータを添付ファイルとして埋め込むことができます。PDF内のアイコンやサムネイルをダブルクリックして、Oleオブジェクトの元のファイルを開くことができます。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |