Hello, when converting pptx file, which contains images, to PDF file some of the images get really degraded. We are using api (https://api.aspose.cloud/v3.0/slides/convert/Pdf
), with no resolution option.
See examples below:
[pptx](https://bizzabo-demo-res.cloudinary.com/raw/upload/v1731322796/Mediashare/jmsfpt9wggkfdybsorzo.pptx https://bizzabo-demo-res.cloudinary.com/image/upload/v1731322796/Mediashare/jmsfpt9wggkfdybsorzo.pptx.pdf)
pdf
Could you please help here to resolve this issue?
@Cloudinary
When converting a PPTX file to PDF, if you are experiencing issues with image quality degradation, you can utilize custom options to enhance the output quality. The Aspose.Slides API allows you to specify various settings that can help improve the quality of images during the conversion process.
Here are some steps you can take to address the image quality issue:
-
Set JPEG Quality: You can adjust the JPEG quality setting to a higher value. This can significantly improve the quality of images that are saved in JPEG format during the conversion.
-
Handle Metafiles: You can specify how metafiles should be treated during the conversion. For instance, saving metafiles as PNG can yield better quality compared to other formats.
-
Text Compression: Adjusting the text compression level can also impact the overall quality of the PDF.
-
DPI Settings: If available, setting the DPI (dots per inch) for images can enhance the resolution of the images in the resulting PDF.
Here is a sample code snippet demonstrating how to implement these options in C#:
using Aspose.Slides;
using Aspose.Slides.Export;
public class ConvertToPDF
{
public static void Run()
{
// Load the presentation
using (Presentation presentation = new Presentation("path/to/your/presentation.pptx"))
{
// Create PdfOptions and set custom options
PdfOptions pdfOptions = new PdfOptions();
pdfOptions.JpegQuality = 90; // Set JPEG quality
pdfOptions.SaveMetafilesAsPng = true; // Save metafiles as PNG
pdfOptions.TextCompression = PdfTextCompression.Flate; // Set text compression
// Save the presentation to PDF with specified options
presentation.Save("output.pdf", SaveFormat.Pdf, pdfOptions);
}
}
}
By applying these custom options, you should see an improvement in the quality of images in the converted PDF. If you continue to experience issues, consider checking the original image resolutions in your PPTX file, as low-resolution images will still appear degraded in the PDF regardless of the conversion settings.
For more detailed information on converting PowerPoint presentations to PDF with custom options, you can refer to the official documentation here.
Sources:
[1]: Convert PowerPoint to PDF in Python - Aspose Documentation
@Cloudinary,
I’ve 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): SLIDESCLOUD-1998
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.
Thank you!
How can we track the fixes of this issue?
@Cloudinary,
The status of the issue can be seen at the bottom of this forum thread. You will also be notified when the issue is resolved.
Could you please also indicate the Aspose.Slides Cloud SDK and version you used?
As I mentioned at the beginning of the thread, we’re using api v 3.0
@Cloudinary,
Thank you for the additional information. I’ve forwarded it to our developers.
@Cloudinary,
Our developers have investigated the case. Unfortunately, we cannot promise a quick fix for the API Reference issue. We recommend you use the Convert
method via cURL or Aspose.Slides Cloud SDKs. We apologize for any inconvenience caused.
Thank you! When you’re saying convert method - can you please provide a link/ reference/api for that? Since we are already using convert:
https://api.aspose.cloud/v3.0/slides/convert/Pdf
@Cloudinary,
The Convert method can be used correctly in programming languages such as C#, Java, Python and many others. Here are all the SDKs for them: Presentation Maker & Slide Converter Cloud SDKs & REST APIs