We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Ppt to pdf taking too long

Hi,

I am using Aspose.Slides 17.8 for document conversion.
OS - windows 7 (64 bit)
CPU - 8 cores
RAM - 8GB

I am using aspose for document conversion and sometimes it takes too long for conversion and blocks the thread. Link for the document:
https://drive.google.com/file/d/0B-c81CvfvjkId2JxVlFaUjE5OEE/view?usp=sharing

@poojard,

I have worked with presentation file shared by you on a VM on my end. It took 57 seconds to export presentation to PDF on my end which is roughly 26MB file. I feel this time taken is OK. Can you please share the performance achieved on your end for comparison as well.

When I am doing this individually it’s taking 1 minute at my end as well. But let’s say when I am converting multiple documents using multi-threading ideally it should not block other threads but that what is happening.
OS- Windows 7(64bits)
Java - jdk_1.8.0_144
Aspose.Slides - 17.8
RAM - 8GB
CPU - 8 cores

It blcoks the thread for 4-5 minutes

Please find the sample code

ExecutorService executorService =  Executors.newFixedThreadPool(4);
  
private void convertDocument(File file) {
        String fileName = file.getName();
        String filePath = file.getAbsolutePath();
        Future future = null;
        logger.info("file conversion started for  -> " + fileName + " at " + new Date());

        future = executorService.submit(() -> {
            if (FileExtensions.ppt.name().equalsIgnoreCase(FilenameUtils.getExtension(fileName))
                    || FileExtensions.pptx.name().equalsIgnoreCase(FilenameUtils.getExtension(fileName))) {
                try {
                    Presentation presentation = new Presentation(filePath);
                    presentation.save(outputDirectory + FilenameUtils.removeExtension(fileName) + ".pdf", SaveFormat.Pdf);
                    logger.info("file converted succcessfully -> {} at {}", fileName, new Date());
                } catch (Exception e) {
                    logger.error("Failed to convert document -> {} with error {}", fileName, e.getMessage());
                }
            } else if (FileExtensions.doc.name().equalsIgnoreCase(FilenameUtils.getExtension(fileName))
                    || FileExtensions.docx.name().equalsIgnoreCase(FilenameUtils.getExtension(fileName))) {
                try {
                    Document document = new Document(filePath);
                    document.save(outputDirectory + FilenameUtils.removeExtension(fileName) + ".pdf");
                    logger.info("file converted succcessfully -> {} at {}", fileName, new Date());
                } catch (Exception e) {
                    logger.error("Failed to convert document -> {} with error {}", fileName, e.getMessage());
                }
            } else if (FileExtensions.xls.name().equalsIgnoreCase(FilenameUtils.getExtension(fileName))
                    || FileExtensions.xlsx.name().equalsIgnoreCase(FilenameUtils.getExtension(fileName))
                    || FileExtensions.xlsm.name().equalsIgnoreCase(FilenameUtils.getExtension(fileName))) {
                try {
                    Workbook workbook = new Workbook(filePath);
                    workbook.save(outputDirectory + FilenameUtils.removeExtension(fileName) + ".html", com.aspose.cells.SaveFormat.HTML);
                    logger.info("file converted succcessfully -> {} at {}", fileName, new Date());
                } catch (Exception e) {
                    logger.error("Failed to convert document -> {} with error {}", fileName, e.getMessage());
                }
            } else {
                logger.info("Ignoring document conversion since document is non-MS document -> {} ", fileName);
            }
        });
        futures.add(future);
}

Does Aspose.Slides 17.8 supports multi-threading ?
Do you have any sample examples for using aspose in multi-threading environment where each thread separately works on individual document.

That would be much helpful for me

@poojard,

I have observed your comments and like to mention that Aspose.Slides does support multi-threading applications with multiple threads. I request you to please provide used source presentation files and a working sample project reproducing the issue on your end so that we may try reproducing and investigating the issue on our end.

I have shared the sample code. I won’t be able to share sample documents since they are from prod environment and that’s not allowed.

@poojard,

I have observed your comments and like to share that an issue with ID SLIDESJAVA-36601 has been created as investigation in our issue tracking system to further investigate the issue for multi-threaded environment. We may try reproducing issue on our end based on information shared by you. However, we may request you to please share other source files as well if we are unable to reproduce the issue based on available information.

Hi Mudassir,

Any update on this issue. I am stuck here.

@poojard,

I have verified from our issue tracking system and regret to share that the issue has just recently been added in our issue tracking system and is pending for investigation. Our product team shall be scheduling the issue on it due turn and we will share the feedback with you as soon as it will be shared by our product team.

@poojard,

Our product team has investigated the issue on their end and have not been able to reproduce this issue. All PDF have been generated successfully. We have observed that you have used a few presentations and the problem can be in the interaction of several presentations. Can you please provide other presentations for testing or a project for reproducing this issue?

Please also share what java arguments are used by the you for this process (like -Xmx, -Xms and etc.)?

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