Skip to main content

Notifications

Power Automate - Building Flows
Unanswered

Using a variable to pass the value of a PDF file to the Encodian OCR action.

Like (0) ShareShare
ReportReport
Posted on 20 Dec 2024 15:59:28 by 16

I have a flow, where I am checking in a condition whether the file in question is a PDF or not.

If the file is a PDF, then the file content is set in variable declared earlier in the flow. If its not a PDF, then the file gets converted into a PDF through an encodian action and saved in the same variable.

 After the condition, I am trying to Apply OCR on the file.. But I am always getting the error - "Please provide a valid PDF document"

 I have tried converting the variable to base 64 format but that still gives the error.

 Has anyone faced a similar issue in the past and is aware of a workaround?

 

  • ShantanuSri Profile Picture
    ShantanuSri 16 on 23 Dec 2024 at 10:35:30
    Using a variable to pass the value of a PDF file to the Encodian OCR action.
    @Artur Stepniak Thanks for your response.
     
    In a condition, I am checking whether the file is a PDF or not.
     
    If the file is a PDF, the file gets stored in a variable. 
     
    If the file is not a PDF, the file gets converted into PDF and then stored into a variable.
     
     
     
     
    After the condition, I need to OCR the PDF file that is stored in the variable. This step is where my flow is failing and giving the 'valid PDF' error.
     
    I have tried to convert the file to base64, etc. but that still gives the error.
     
    Please let me know if any other details might help in answering the query.
     
  • Artur Stepniak Profile Picture
    Artur Stepniak 860 on 23 Dec 2024 at 09:00:10
    Using a variable to pass the value of a PDF file to the Encodian OCR action.
    Hello,
     
    you'd need to check the file format - I'm not sure where it's stored at first, but it could be already a base64 string. You can save it somewhere first, using OneDrive for example, and then get the file content, and use it in the Encodian action.
     
    Let me know how it goes.
     
    In case of any other questions, let me know. If the answer helped you, mark it, so that others can benefit from it.
     
    Best regards,
     
    Artur Stepniak
    Interested in GenAI? Visit my site!

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #9 Get Recognized…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,154

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,270

Leaderboard
Loading started