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 🙂 

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
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

AI Builder AMA June 7th carousel (up on May 25th, take down June 8th) (1).png

'Ask Microsoft Anything' about AI Builder!

The AI Builder team invite you to ask questions and provide helpful answers at our next AMA.

Users online (1,585)