We have been working with Aspose Slides v25.7 for our product where in we have EMF images to be printed into PDF but we found that the Semi-transparent images (Alpha = 50% or between 1-99 % ) it renders blank image in pdf.
I have attached the sample PDF generated and the Sample EMF image. I have tried to “Save As PDF” this from Microsoft PowerPoint and It saved it properly into PDF(Attached)
Transparency-Issue.zip (145.6 KB)
.
We are using pdfOption for vector output: auto pdfOptions = System::MakeObject<Aspose::Slides::Export::PdfOptions>(); pdfOptions->set_SaveMetafilesAsPng(false); if (!pdfPath.empty()) { pImpl->presentation->Save(StringtoU16(pdfPath.c_str()).c_str(), Aspose::Slides::Export::SaveFormat::Pdf, pdfOptions); status = true; }
@ashvek.gaonkar
It appears you are encountering an issue with semi-transparent EMF images rendering as blank in PDFs when using Aspose Slides v25.7. This issue may arise due to the way transparency is managed during the conversion process.
To resolve this, you can implement the following workaround:
- Set
SaveMetafilesAsPng to true: This option converts EMF images to PNG format during the PDF export, which may better handle transparency.
Here’s how you can modify your code:
auto pdfOptions = System::MakeObject<Aspose::Slides::Export::PdfOptions>();
pdfOptions->set_SaveMetafilesAsPng(true); // Enable PNG conversion for EMF images
if (!pdfPath.empty()) {
pImpl->presentation->Save(StringtoU16(pdfPath.c_str()).c_str(), Aspose::Slides::Export::SaveFormat::Pdf, pdfOptions);
status = true;
}
- Update Aspose Slides: If feasible, consider upgrading to a newer version of Aspose Slides, as subsequent releases may include enhancements or bug fixes that address this issue.
If the problem continues, you may want to consult the Aspose forums or documentation for any specific updates or additional options that could assist with rendering transparency in EMF images.
Please let me know if you have any further questions!
As I have mentioned specifically, we want the vector output. Using SaveMetafilesAsPng(True) will result in output to be raster
@ashvek.gaonkar,
Thank you for reporting the issue. I have reproduced the problem where the semi-transparent EMF image becomes blank when converting a presentation containg the image to PDF. We apologize for any inconvenience caused.
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): SLIDESCPP-4074
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.