We have historically used Aspose PDF with .NET to embed attachments into an existing PDF in certain circumstances which all works fine. The basic structure is below:
var MainPDF = new Aspose.Pdf.Document(“pdfdoc.pdf”);
var EmbeddedFile = new Aspose.Pdf.FileSpecification(“EmbeddedFile”, “Title”);
We are now attempting to integrate with SharePoint. As far as we know, Aspose won’t source file content directly from SharePoint, so we generate MemoryStreams containing the MainFile and the EmbeddedFile, create the document and FileSpecification from the streams and then persist the stream back to SharePoint.
Problems seem to manifest in that the attachments to the PDF are there but are zero bytes in size, and we seem to be unable to set the MIMEType on the Aspose.Pdf.FileSpecification object.
Can you please let me know if this type of use-case is supported?
Correction: The files appear as zero bytes in the hint text of the attachment in Acrobat Reader, but are in fact fully embedded. If the FileSpecification.Name is suffixed with the mime type (in this case .PDF) then all seems to work.