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 / Extract text from spec...
Power Automate
Unanswered

Extract text from specific regions in a PDF

(0) ShareShare
ReportReport
Posted on by 52

Looking for a solution to extract text from 3 zones in PDF files (2 in header and 1 in footer). I built a cloud flow using Encodian which works but I will need a paid subscription to use this on a large scale which I am trying to avoid if possible. I am struggling a bit with the PAD flow and keep getting the below error:

 

Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException: Can't rename file ---> System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.GetExtension(String path)
at Microsoft.Flow.RPA.Desktop.Modules.File.Actions.RenameFilesAction.<>c__DisplayClass106_0.<GetNewFileNameResolver>b__0(FileObject file)
at Microsoft.Flow.RPA.Desktop.Modules.File.Actions.RenameFilesAction.Execute(ActionContext context)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.File.Actions.RenameFilesAction.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

 

 

michalt1_0-1680886043520.png

 

The text I am trying to extract is English and nothing complex, what am I missing?

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @michalt1 

     

    Issue is at renaming file, just check whether you have passed any illegal characters to filename which prevents its naming 

  • michalt1 Profile Picture
    52 on at

    Thanks but the text is nothing illegal. It is what I would have manually renamed my PDF file to.

     

    Example:

    SMITH, John - H-1B Filing.pdf

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @michalt1 

     

    Could you show Rename file action you have used to see what is the issue ?

  • michalt1 Profile Picture
    52 on at

     

    michalt1_0-1681220537668.png

     

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @michalt1 

     

    %Files% is a list of filepath values inside it. so why you are passing an extra N:\Copier\TEST2\ before that ?

     

    You can just pass %Files% itself in the field right ??

  • michalt1 Profile Picture
    52 on at

    Thanks you're right about that! Modified that and says flow was successful but the file name did not change to the text OCR should have extracted.

     

    Maybe I am not setting my regional parameters correctly? Can someone help guide on that maybe??

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @michalt1 

     

    As per the current code it will rename all file with the value present in %OcrText% , so may i know how file name looked like ?

  • michalt1 Profile Picture
    52 on at

    The original file name is:  doc00382220230406103.pdf

     

    The intended file name is OCR Text that is found in the footer of the first page of the PDF (where the region should be pointing to):   SMITH, John - H-1B Filing.pdf

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    What result u are getting when using the above action, is only file is renamed or not any files are renamed ?

  • michalt1 Profile Picture
    52 on at

    It says the flow has run successfully but nothing happens. The file name does not change.

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

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 231 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 217 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 170

Last 30 days Overall leaderboard