Incrustar adjunto en PDF con C++
Contents
[
Hide
]
En Excel, puedes insertar un Objeto OLE con datos de origen (embedded-attachments-example.xlsx). Haz doble clic en el Objeto OLE y el archivo incrustado se abrirá.
Por lo general, al convertir a PDF, el Objeto OLE se renderiza como un icono o una miniatura sin los datos del origen del Objeto OLE. Con la opción PdfSaveOptions.GetEmbedAttachments(), puedes incrustar los datos del origen del Objeto OLE como un adjunto en el PDF. Puedes hacer doble clic en el icono o la miniatura en el PDF para abrir el archivo fuente del Objeto OLE.
#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
int main()
{
Aspose::Cells::Startup();
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C
// Open the template file
Workbook workbook(u"embedded-attachments-example.xlsx");
// Set to embed Ole Object attachment.
PdfSaveOptions pdfSaveOptions;
pdfSaveOptions.SetEmbedAttachments(true);
// Save the pdf file with PdfSaveOptions
workbook.Save(u"output.pdf", pdfSaveOptions);
std::cout << "PDF saved successfully with embedded attachments!" << std::endl;
Aspose::Cells::Cleanup();
}