Need to compare contents of word template & actual PDF

I have 2 files (word & pdf) and need to compare them. word doc will be template which defines how pdf should be generated. Below are the samples.

Word doc:

    <firstname>,<LastName>
    <ID>,<organization>
    <salary>,<place>
    
    Dear <firstname>,
    you are working in the department of <organization> and we are really honored to have you here. Expecting many more successful years of service from you.
    Thanks,

Actual PDF:

    John, Kennedy
    234,google
    USD1245,CA
    
    Dear John,
    you are working in the department of google and we are really honored to have you here. Expecting many more successful years of service from you.
    Thanks,

Can someone help with the comparison logic to validate both the static and dynamic content are getting generated as expected??
we are using TestComplete with JavaScript for the automation.