cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
klausrossmann
New Member

Merge multiple PPTX flies

Hi everybody,

 

I want to merge multiple PPTS files into one presentation. The solution posted in https://powerusers.microsoft.com/t5/Building-Flows/Merge-PowerPoint-slides/m-p/388163#M43991 works for me, but I want a little bit more.

  • I don't want to take the whole presentations, but only a subset of the slides in the presentations, e.g. merge only the first slides of my presentations.
  • Ideally, a user should be able to provide the Flow with a list of files, that would then be merged.

Does anybody know how to do any of this?

 

Thanks a lot in advance!

1 ACCEPTED SOLUTION

Accepted Solutions

I hope you know bases of programming and creating api otherwise it can be hard 😉 If you will have more questions I will try to send you my example of azure functions to copy paste and try to mimic that. 

 

1st azure: https://azure.microsoft.com/en-us/free/search/?&ef_id=EAIaIQobChMIo9-G_cac6gIVEo4YCh1JdgDHEAAYASAAEg...

 

2nd script: https://medium.com/@cloudmersive/how-to-merge-two-powerpoint-pptx-files-together-in-python-10b6609d6...

3rd azure functions full tutorial: https://docs.microsoft.com/en-us/azure/developer/python/tutorial-vs-code-serverless-python-01

 

If my post was helpful don't forget about kudos and marking as solution 🙂 

View solution in original post

7 REPLIES 7
rohsh354
Microsoft
Microsoft

Hello,

 

Unfortunately, there is no native or OOB way to merge specific slides from one PPT to another. You can post this as an idea in the forum below:

 

https://powerusers.microsoft.com/t5/Power-Automate-Ideas/idb-p/MPAIdeas

 

 

KamilAdamczyk
Continued Contributor
Continued Contributor

You need to create test account on the azure (free for 12 months) and create own connector on azure functions. Use ready python script.

Hi @KamilAdamczyk,

thanks a lot for your reply.

Can you guide me a little bit on what I have to do? That would be great!

I hope you know bases of programming and creating api otherwise it can be hard 😉 If you will have more questions I will try to send you my example of azure functions to copy paste and try to mimic that. 

 

1st azure: https://azure.microsoft.com/en-us/free/search/?&ef_id=EAIaIQobChMIo9-G_cac6gIVEo4YCh1JdgDHEAAYASAAEg...

 

2nd script: https://medium.com/@cloudmersive/how-to-merge-two-powerpoint-pptx-files-together-in-python-10b6609d6...

3rd azure functions full tutorial: https://docs.microsoft.com/en-us/azure/developer/python/tutorial-vs-code-serverless-python-01

 

If my post was helpful don't forget about kudos and marking as solution 🙂 

View solution in original post

Thanks, that looks great!

I think I'll be able to create an Azure Function that splits PPTX Files now!

But one more question: is there a way to include this in my MS Flow then? Or do I have to build my complete solution in Azure Functions?

Then you need to create custom connector or use it as http request. I prefer 1st option.

one advice. Dont use application json content type to recieve data. Look at my function for merging pdf for PyPDF4 python library 

import logging

import azure.functions as func

from PyPDF4 import PdfFileMerger
import io
import base64
import json
import pdfrw


def main(req: func.HttpRequest) -> func.HttpResponse:
    logging.info('Python HTTP trigger function processed a request.')

    try:
        req_body = req.get_json()
    except ValueError:
        pass
    pdf1 = req_body.get('pdf1')
    pdf2 = req_body.get('pdf2')

    if pdf1 and pdf2:
        input1 = io.BytesIO(base64.b64decode(pdf1))
        input2 = io.BytesIO(base64.b64decode(pdf2))
        input1.seek(0)
        input2.seek(0)

        output = io.BytesIO()
        merger = PdfFileMerger(output)

        merger.append(input1)
        merger.append(input2)
        merger.write(output)
        merger.close()
        output.seek(0)
        print("Successfully merged")

        return func.HttpResponse(output.getvalue(),
            headers={'Content-Type':'application/pdf'}
            )
    else:
        return func.HttpResponse(
            json.dumps({
                'status': 'error',
                'content': 'Unable to parse pdf1 and pdf2'
            }),
            mimetype="application/json",
            status_code=400
            )

 

 

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (37,075)