web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Read data from PDF and compare it with a table in D365 F&O

(0) ShareShare
ReportReport
Posted on by 339

Hi everyone,

How can I read data from a PDF file in D365 F&O (X++) and compare it against a table, to find records that are missing or extra?

Thanks in advance.

Categories:
  • Martin Dráb Profile Picture
    241,408 Most Valuable Professional on at

    Please tell us more about what you need from us. Is your problem specific to reading the PDF, or do you mean that you don't know how to compare the data either?

     

    A critical piece of information is what you have in the PDF. Do you have text there, e.g. something that you can highlight by mouse in Acrobat Reader and copy it? Or is it an image embedded in PDF and you'll need OCR to convert it to text?

  • Raed Salah Bzour Profile Picture
    339 on at

    Hi ,
    My problem is mainly reading the PDF. The comparison I can handle.

    The PDF contains a list of flights. I need to extract three fields from it: Ticket number, PNR number, and Amount. Then I'll compare them with my table in D365 to find any flights that are missing or if the amount is incorrect.
    this is pic of the PDF:
     

  • Subra Profile Picture
    2,405 Super User 2026 Season 2 on at

    HI @Raed Salah Bzour 

    I don't think we can read the PDF file using X++ but you can use logics apps or power automate flow to covert this into data and compare with your table.

     

  • André Arnaud de Calavon Profile Picture
    307,747 Super User 2026 Season 2 on at

    Hi Raed,

    PDF files are of a specific format that in case of selectable text can be read with a correct API/DLL, also using X++. You haven't answered the question from Martin if the PDF is one large image or if it has a structure with text. 

    Next to read the document using X++, you can also build an agent or use M365 Copilot/Cowork connected with the MCP server. You can then instruct AI to read the contents and compare it with data in Dynamics 365. 

  • Raed Salah Bzour Profile Picture
    339 on at

    Hi ,
    Sorry, I missed that question from Martin.

    The PDF has selectable text, I can highlight and copy it. It's generated by Crystal Reports, not a scanned image, so no OCR is needed.

    Below is a sample page from the PDF showing the layout I need to extract data from.
     

    Given that, is a C# class library referenced from X++ (e.g. using PdfPig to extract the text) the right approach, or would you recommend something else for a report with this layout?
     

  • Martin Dráb Profile Picture
    241,408 Most Valuable Professional on at

    Using a .NET library is a possible approach. Whether you should call it from X++ or somewhere else depends on your business requirements and the architecture you choose.

     

    For example, instead of doing it in X++, you may have a Power Automate flow reading PDF files from a storage, extracting the data (e.g. by an Azure Function using a .NET library), getting F&O data by OData, comparing the data and triggering an action. Maybe it'll just do the parsing and put the data to F&O for further processing. Maybe you can utilize a desktop flow with Extract tables from PDF action.

     

    It's quite common that people want such a logic outside F&O, so they don't have to do X++ development and a deployment if the file structure changes and they need some adjustments of the logic.

  • Suggested answer
    CU-1234529-002 Profile Picture
    568 on at

    Hi @Raed Salah Bzour ,

    Using a C# DLL to achieve this, Is this PDF generated automatically (e.g., dropped into a folder/system on a schedule), or will you be uploading it manually each time?
    Better approach use power automate flow, which have inbuild pdf extractor actions
    Thanks

  • Raed Salah Bzour Profile Picture
    339 on at

    Thank you all.

    Could you please share the steps for doing this? Any blogs or videos would help.

  • Martin Dráb Profile Picture
    241,408 Most Valuable Professional on at

    What do you mean by this? I mentioned several different approaches; the steps obviously depends on what what you decide to implement.

  • Anton Venter Profile Picture
    21,296 Super User 2026 Season 2 on at

    @Raed Salah Bzour 

    I'm curious, perhaps you have checked this already. Can't you get the data you need in another format from the source system? Perhaps the source system has an API or they can send the data in another format.

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!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 543 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 415 Super User 2026 Season 2

#3
CU-1234529-002 Profile Picture

CU-1234529-002 188

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans