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
Anonymous
Not applicable

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
Community Support
Community Support

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

 

 

Anonymous
Not applicable

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 @Anonymous,

thanks a lot for your reply.

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

Anonymous
Not applicable

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?

Anonymous
Not applicable

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

Anonymous
Not applicable

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,816)