web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / "Merge PDF Files" Acto...
Power Automate
Unanswered

"Merge PDF Files" Acton - Error (Object reference not set to an instance of an object.)

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Community 

 

I am facing an issue while merging two PDF files through Power Automate Desktop. Can anyone help?

 

Error:Microsoft.Flow.RPA.Desktop.Robin.SDK.ActionException: Failed to merge PDF files: 'C:\Users\Umar.Shahzad\Desktop\Registry6.pdf', 'C:\Users\Umar.Shahzad\Desktop\Registry3.pdf' ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Flow.RPA.Desktop.Modules.PDF.Actions.PDFium.PDFium.FPDF_SaveAsCopy(IntPtr doc, FPDF_FILEWRITE writer, Int32 flags)
at Microsoft.Flow.RPA.Desktop.Modules.PDF.Actions.MergePDFFilesAction.Execute(ActionContext context)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.PDF.Actions.MergePDFFilesAction.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

 

Screenshot 2022-01-20 150916.png

I have the same question (0)
  • Benny_1857 Profile Picture
    124 on at

    Not sure, I tried same way and no problem.

    Benny_1857_0-1642734912231.png

    Also, I read some tips that upload the files into web for PDF to do that.

    https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/

    It might be another way to automatic.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you Benny_1857

     

    Let me explain in detail. 

     

    I use the action "Merge PDF Files" and use it to merge two files, namely Registry 1 and Registry 2. The process runs successfully but in the merged file Registry 2 comes as first page Registry 1 as second despite the fact the sorting is ascending. I want to Registry1 to become the first page. So I thought it may be due to sorting. So I changed the sorting to descending and run. However, this time the process goes in error and produces the error in my first message. No matter what I do I am unable to make registry 1 as first page. Can you please test this at your end and let me know if you end up in the same error. 

     

    Thanks

  • Riyaz_riz11 Profile Picture
    4,214 Super User 2026 Season 1 on at

    Ahammad_Riyaz_0-1642745930862.png

    Pease refer this, for me it was working.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks Ahammad. Can you please check the page order in which they were merged. I also messaged earlier a bit in detail. Were you able to reproduce the issue by changing the sort order?

  • Benny_1857 Profile Picture
    124 on at

    When I get the files from folder, I set the accending sort by FullName in advanced. 

    It works.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks. For some reason it is not working for me.

  • Benny_1857 Profile Picture
    124 on at

    I am not sure. I just guess whether it is because of sort by text?

    For example sort 3 file name acceding. A2.PDF,A3.PDF,A12.PDF
    After sort it will be A12.PDF,A2.PDF, A3.PDF

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Sorting is perfectly working fine. But merge is not merging according to sort order. If I select ascending it merges fine but in descending order. If I select descending it goes into error. 

  • XRQ57 Profile Picture
    206 on at

    Hi,

    I tried too and no problem for me.

     

    Have you the last version of PAD?

  • Kinsleylury Profile Picture
    4 on at

    Use the PDF CAMP PDF Merge Tool, which is risk-free program to use without any issues, to combine multiple PDF files into a single PDF file. It takes care of all of your PDF merging issues. Because of all of its incredible features, this software is the total package for users. It is simple to use and supports all Windows OS editions, and can merge multiple PDF files at once. In fact, it provides a free demo version for the testing. Users can assess the tool's operation in the demo pack, which is highly beneficial to all users.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 167

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard