Search code examples
node.jspdf-generationadobepowerpointdocument-conversion

Converting adobe inDesign to pptx (is it even possible?)


I'm struggling to find a solution. I have a bulk of Adobe inDesign files I'm trying to convert over as PDFs

I know you can export to inDesign -> PDF then from Acrobat PDF -> PPTX. This would work well if it was just one or two files. I don't want to keep doing this over and over. I've tried using pdf-powerpoint the only issue with that is it exports each slide as a PNG. I would still like to be able to edit them afterward. I've seen that it is possible to use javascript to automate Adobe products but, after combing through their documentation I'm not sure if it's possible to pipe data into other Adobe products. Any suggestions?


Solution

    • You want to convert a PDF file to a Microsoft Powerpoint file (pptx).
    • You want to achieve this using Node.js.

    If my understanding is correct, how about this workaround? In this workaround, it uses an external API which is ConvertAPI. The pptx file converted by this API can be edited by Microsoft Powerpoint. When you try this, for example, you can also test this using "Free Package". When you try using "Free Package", please Sign Up at "Free Package" and retrieve your Secret key.

    Sample script:

    const fs = require('fs');
    const request = require('request');
    
    const pdfFile = "### PDF file ###"; // Please set PDF filename including the path.
    const url = "https://v2.convertapi.com/convert/pdf/to/pptx?Secret=#####"; // Please set your Secret key.
    
    const options = {
        url: url,
        method: 'POST',
        formData: {File: fs.createReadStream(pdfFile)},
    };
    request(options, function(err, res, body) {
        if (err) {
            console.log(err);
            return;
        }
        const obj = JSON.parse(body);
        obj.Files.forEach(function(e) {
            const file = new Buffer(e.FileData, "base64");
            fs.writeFile(e.FileName, file, function(err) {
                if (err) {
                    console.log(err);
                    return;
                }
                console.log("Done.");
            });
        });
    });
    

    Note:

    • Before you run ths script, please retrieve your secret key.
    • In this script, a PDF file is uploaded and converted to pptx file, and download it. Then, it is saved as a pptx file.
    • This is a simple sample script. So please modify it for your situation.

    Reference:

    If this workaround was not what you want, I'm sorry.