Read PDF with OCR doesn't work with C# projects

Hi,

I am not able to use the activity Read PDF with OCR. I have the following message error:
A warning message states that multiple languages requiring compilation, specifically C#, are detected in the activity definition and advises converting all expression activities to a single language. (Captioned by AI)

I am using Studio 2024.10.8 with C# language (Windows project) and the package UiPath.PDF.Activities 3.16.0. For the rest of the packages, I am using the latest versions.

I tried to isolate the activity in a workflow as described in the 2.8 section of this topic Troubleshooting Guide : Conversion from Windows-Legacy project to Windows project but I still have the message error.

Do you have any idea of how to make this activity work in a C# Project?

Thanks a lot for your help!

@melanie

Try to change the system packages and pdf package versions and check if the issue persists

Cheers

The issue occurs because Read PDF with OCR internally uses VB.NET expressions, while your project is in C#. Since Windows projects enforce a single-language rule, this causes a compilation conflict.

  1. Use an Isolated Workflow (Ensure Arguments are Correct)

You mentioned trying this, but double-check these steps:

  1. Create a Separate Workflow (.xaml)
    Right-click your project → Add → Sequence(or a new workflow).
    Ensure this new workflow is VB.NET-based (not C#).
    Move the Read PDF with OCR activity into this workflow.

  2. Pass Arguments Properly
    Define In/Out arguments to send/receive data between your C# main workflow and the VB.NET workflow.

  3. Convert Project to VB.NET

If your project isn’t deeply reliant on C#, consider converting it back to VB.NET(though not ideal if you prefer C#).

I can confirm this behaviour, the activity seems broken in a C# project. This can be demonstrated by opening a fresh C# project and trying to add the activity, no OCR engines can be added to it whereas in a VB.NET project you can.

I suggest you raise a bug report via the UiPath Helpdesk.
I’ll try to mention it to the product managers and also point out the documentation here contains a project that is in legacy format and should be updated.

1 Like

Can you please try to update to at least 3.19.1 and see if it still reproduces?

We have fixed an issue that seems like yours in that particular patch https://docs.uipath.com/activities/other/latest/document-understanding/release-notes-uipath-pdf-activities#v3191

It does appear that the result from Ioana may fix your immediate issue, however there is still the issue where new PDF OCR activities cannot be added in a C# project (and I think it might be related), so that is also reported as a bug now.

Hope the documentation in the above release notes does fix your issue though!

Edit, seems to be some nuance here related to the OCR engine activities being in a different package and them not being so intuitive to find, but thats not related to the language issue and more a case of if anyone reads this in the future, its perhaps not a bug that the C# project doesn’t get the OCR engines but that the Ux isn’t as straightforward as maybe it could be.

2 Likes

Hi,

I am not able to update the package UiPath.PDF.Activities. The latest available on my side is 3.16.0.

Thanks

Hi,

Thanks a lot for your help!

I am not sure I have understood the end of your message, I also opened a ticket to UiPath on my side and I hope they’ll fix it soon :crossed_fingers:

Best regards,