Free Support Forum - aspose.com

Aspose slides pdf file is 4 times orginal PPT doc

We are planning to use Aspose Java (Slides, Cell, and words) to generate pdf previews in realtime.

  • Quality of generated PDF preview vs speed we will go for speed.
  • Quality of generated PDF preview vs memory usage we will go for less memory
  • All file sizes for words, slides and Cell will be less than 10 MB

During our tests for this file the PDF size is 14MB where as original PPT file is 3 MB. I have attached the file also

Here are the code snippet we are using
Below are the relevant code snippets

private void slidesPreview(InputStream src, OutputStream dst) {
Presentation presentation = new Presentation(src);
PdfOptions options = getSlidesPdfOptions();
presentation.save(dst, com.aspose.slides.SaveFormat.Pdf, options);
}

private PdfOptions getSlidesPdfOptions() {

    PdfOptions options = new PdfOptions();
    options.setJpegQuality((byte) 10);
    options.
    return options;
}

Do you have any recommended setting for the above requirements where we just want to create a pdf preview?

Looking forward to your response.

Regards

Kamranpowerpoint_3MB.pptx.zip (2.7 MB)

@Kamran12,

I have worked with the presentation file shared by you and have been able to observe the issue specified. An issue with ID SLIDESJAVA-37099 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be fixed.

Thanks , is there any workaround to this problem that we can use until this is fixed?

Regards
Kamran

@Kamran12,

I have worked with sample file shared by you. I have shared code snippet with you that will help you to achieve your requirements. Please share feedback with us if there is still an issue.

Presentation presentation = new Presentation(path+“pp.pptx”);
//PdfOptions options = new PdfOptions();
PdfOptions options = new PdfOptions();
// options.setJpegQuality((byte) 10);

options.setBestImagesCompressionRatio(true);
// setSaveMetafilesAsPng(false);
presentation.save(path+“size15.pdf”, com.aspose.slides.SaveFormat.Pdf, options);

size15.pdf (4.7 MB)

Hi Adnan
I have tried your suggestion and same as you see the pdf is 4.9 MB, where as the original file is 3 MB.
Do you have an ETA for the fix?

Regards

Kamran

@Kamran12,

Can you please check sample code shared below on your end and share feedback with us if there is still an issue. This sample code generated 1.80 MB file.

Presentation pres=new Presentation(path+“pp.pptx”);
PdfOptions opt = new PdfOptions();
opt.setBestImagesCompressionRatio(true);
opt.setJpegQuality((byte)90);
//Presentation pres = new Presentation(“pp.pptx”);
pres.save(path+“slides_18.5_java.pdf”, SaveFormat.Pdf, opt);

slides_18.5_java.pdf (1.8 MB)

Hi Adnan
Thanks. This worked.

Regards
Kamran

The issues you have found earlier (filed as SLIDESJAVA-37099) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by mudassir.fayyaz