Hello Team,
We have a need of converting PPT files (contained embedded attachments) to pdf file. However, using Aspose we are not able to do so. Below are the required details:
- Aspose Version: 23.12.0.0
- OS version on which conversion is happening:
Edition |
Windows 10 Enterprise |
Version |
21H2 |
OS build |
19044.2486 |
Experience |
Windows Feature Experience Pack 120.2212.4190.0 |
- Dot Net framework: .Net Framework 4.8
- Below is the code we are using:
Presentation presentation = new Presentation(inputFilePath);
var pdfOptions = new PdfOptions
{
SufficientResolution = 300,
EmbedFullFonts = true,
EmbedTrueTypeFontsForASCII = true,
Compliance = PdfCompliance.PdfA1a,
};
presentation.Save(outputFilePath + ".pdf", Aspose.Slides.Export.SaveFormat.Pdf, pdfOptions);
However, when the PPT file is being converted to pdf, the embedded attachments are not exported properly and it shows only icons. I am attaching the ppt file and converted pdf file for your reference.
Please have a look into this issue and share your views.
Presentation.zip (1.6 MB)
Please let me know in case of any queries. Waiting for your response.
Thanks.
@lpappachen,
Thank you for reporting on the issue. I reproduced the problem you described.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): SLIDESNET-44507
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
@lpappachen,
The issue is still open. Unfortunately, I don’t have any additional information yet.
Hi @ andrey.potapov,
It’s been ~3 weeks but no updates yet. could you please check and reply the resolution time for this issue?
@lpappachen,
As far as I can see, our developers are working on the issue. We expect that the issue will be resolved in Aspose.Slides for .NET 24.5. This release will be published in the second half of May. Thank you for your patience.
The issues you found earlier (filed as SLIDESNET-44507) have been fixed in Aspose.Slides for .NET 24.7 (ZIP, MSI, NuGet, Cross-platform).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.
Hello,
We have checked the issue by applying ASPOSE.Slides 24.7 as mentioned. However, the issue still persists.
Below are the required details:
Aspose Version: 24.7
Dot Net framework: .Net Framework 4.8
OS version on which conversion is happening:
Edition Windows 10 Enterprise
Version 21H2
OS build 19044.2486
Experience Windows Feature Experience Pack 120.2212.4190.0
Below is the code we are using:
Presentation presentation = new Presentation(inputFilePath);
var pdfOptions = new PdfOptions
{
SufficientResolution = 300,
EmbedFullFonts = true,
EmbedTrueTypeFontsForASCII = true,
Compliance = PdfCompliance.PdfA1a,
};
presentation.Save(outputFilePath + ".pdf", Aspose.Slides.Export.SaveFormat.Pdf, pdfOptions);
However, when the PPT file is being converted to pdf, the embedded attachments are not exported properly and it shows only icons. I am attaching the ppt file and converted pdf file for your reference.
PPT to PDF conversion.zip (1.6 MB)
Please have a look into this issue and share your views.
Please let me know in case of any queries.
Waiting for your response.
Thanks.
@lpappachen,
To convert PowerPoint presentations with embedded files to PDF with attachments, you must set the IncludeOleData
property of the PdfOptions class to true
. Please also note that the PDF/A-1a standard does not allow to add attachments to PDF documents.
Complete code example:
var presentation = new Presentation(inputFilePath);
var pdfOptions = new PdfOptions
{
SufficientResolution = 300,
EmbedFullFonts = true,
EmbedTrueTypeFontsForASCII = true,
IncludeOleData = true
};
presentation.Save(outputFilePath, SaveFormat.Pdf, pdfOptions);
Unfortunately, the attachments cannot be opened by clicking on the icons (PDF documents do not allow this) but you can see them in the list of attachments.
Screenshot of the result: screenshot.png (42.7 KB)
@ andrey.potapov,
By setting the said property in PdfOptions, we are able to see the them in the list of attachments.
However, the attachments’ name is not the same as available in the original document. It seems, it is using static fixed name for each extension. When we are having more than one same extension attachment, it is difficult to identify the attachment. We need to open it and then only the attachment will be identified.
Please find the snap for reference.
image.png (22.6 KB)
Is there any way or any property we need to set to have correct attachment name?
Thanks.
@lpappachen,
Could you please indicate which attachment names in the original document you are referring to? I used the following code example to extact file names from the presentation file:
using var presentation = new Presentation("Presentation.pptx");
foreach (var slide in presentation.Slides)
{
foreach (var shape in slide.Shapes)
{
if (shape is IOleObjectFrame oleFrame)
{
Console.WriteLine(oleFrame.EmbeddedFileName);
}
}
}
Output:
/ppt/embeddings/oleObject1.bin
/ppt/embeddings/Microsoft_PowerPoint_Presentation.pptx
/ppt/embeddings/Microsoft_Word_Document.docx
/ppt/embeddings/Microsoft_Excel_Worksheet.xlsx
The file names are the same.