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 / Processing multiple pd...
Power Automate
Unanswered

Processing multiple pdf files fails, how to handle

(0) ShareShare
ReportReport
Posted on by 8

I have a desktop flow that is processing a batch of invoices in a folder into excel

 

I use "Extract text from PDF" to pull the contents into a text file then parse that row by row into a table and into excel.

 

Functionally it works great, but some of the PDF files fail to extract the text from the PDF.  sometimes it's because there is a blank page at the end of the PDF, but sometimes there's no obvious reason.  All these invoices are coming from the one accounts package and are the same format so I don't know why it's failing.

 

Anyway I could live with the failures, I append _failed onto the end of the filename and they can be processed manually.

 

My problem is that once one PDF fails, they will all fail after that.  it's like the "Extract text from PDF" function crashes and then stays crashed.  Anyone have a suggestion of how to restart that function?  or reccomend a command line tool that works as well as it?

I have the same question (0)
  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    Try to use action level exception 

    if it contains blank page then continue the flow and go to next action

  • jlanigan Profile Picture
    8 on at

    The problem is once the action fails once (and throws the exception) it fails for every subsequent PDF file in the folder.

     

    if I remove the first file that fails then it will run for more files until it hits one, then fails again for all subsequent files

     

  • jlanigan Profile Picture
    8 on at

    I'm going to try something using XPDF tools to do the pdf to text bit outside of power automate

     

  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    or you can use on block error to handle the exception and you can write the rules needed

  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    if it fails for one files it should go to next file right?

    if that is your case then use action level exception 

     

    UshaJyothi20_0-1696506535161.png

    write your condition and select continue flow run and navigate which actions to perform

    Hope this helps

  • jlanigan Profile Picture
    8 on at

    I've done that.  the problem is that once "extract text from pdf" fails on one file, it will fail for all subsequent files.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Is each report always the same amount of pages (not including the blank page)?

  • jlanigan Profile Picture
    8 on at

    No they vary from 1-3 pages in length.

     

    I'm seeing ok results using pdftotext from xpdf and it's working but its definitely a slower process iterating through all the files twice.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 474

#2
11manish Profile Picture

11manish 268

#3
David_MA Profile Picture

David_MA 243 Super User 2026 Season 1

Last 30 days Overall leaderboard