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 Error ...
Power Automate
Answered

Merge PDF Files Error - Object reference not set to an instance of an object

(1) ShareShare
ReportReport
Posted on by 24

I am merging a series of PDFs two at a time. In order to do that I take the two that I am interested in merging and move them to a folder to do the merge. Every once in a while the error below gets thrown. I can sometimes work around this error by queueing less files (~20) or restarting the flow. But because I have thousands of files to merge, doing it 20 at a time would be a hand full.

 

Any help here would be greatly appreciated.

 

Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException: Failed to merge PDF files: 'C:\Users\IG-LabOpenTrons\Desktop\merge pdf test\files to combine\order272655.pdf', 'C:\Users\IG-LabOpenTrons\Desktop\merge pdf test\files to combine\order272655_req.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)

 

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    Are you able to show us some screenshots of your current flow's actions?


    Also, it sounds like this is a Power Automate Desktop error - is that right? I am not sure who around here can move topics to other forums.. but.. you may get more of a response over there. I will flag the resident PAD expert anyway 😉  @VJR 

  • VJR Profile Picture
    7,635 on at

    Hello @David-Immuno 

     

    The error is not re-creatable so its hard to say. Have you got a chance to take a look at any of the forum posts if they have the same error? 

    Some pointers-

    - Is there any pattern like its happening to only specific type of pdf documents or when there is any image based or OCR related page in it?

    - If as you mentioned it works fine with 20 so is it because the internal memory gets full and having a Wait between two successive processing would help? I know Wait would even further delay your thousands of documents but what if PAD doesn't support so much memory at once and needs some "rest" in between.

    - Are you on an old version of PAD and the issue is not occurring in the newer versions?

  • Verified answer
    David-Immuno Profile Picture
    24 on at

    Update - Since I realized it wasn't dependent on any of the files I was merging (for instance it would fail on a set of files but if I run it again with the same files, it would run with no errors) so I decided to change the error management to repeating the action rather than ending the program. Seems to have fixed any issues I was having. Although I still don't know the root cause of the issue.

  • VJR Profile Picture
    7,635 on at

    Repeating the action worked means it may have needed some "breathing time" between two processing.

  • laurorctb40 Profile Picture
    31 on at

    Hi,

     

    I have the same problem today after update from 2.35 to 2.36.

    I try with error management to repeating the action but is not working all the time !!!

    What changes you make on the error management to repeating the action ?

     

    Thanks,

    Laur

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 227 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 213 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 151

Last 30 days Overall leaderboard