I have create one windows application in C#, where automating MsOffice.
In this application, there are n# of projects included. There is a separate project(C#), where automating MsOffice. Because of this, I dont want to use namespaces like, System.windows.forms.. etc.,
This application is created to test the candidate MsOffice skills. The application will ask the candidate to perform any task and then the application will evaluate the word document which was created by the candidate. Based this, candidate will get the score.
Now, I want to create a method to evaluate the picture(specific image inserted with its required height/width) added in word document by the candidate.
In this method, I dont want to save image any where but i just want to compare with the image already given in the folder to the candidate.
I have already searched on google, Ref:
Compare picture in Word file and in a folder?
programmatically comparing word documents
extract image from word file
Extracting Images from doc file in c# using using Microsoft.Office.Interop.Word;
I just want to compare the image in the word document with the image given in the folder to the candidate.
Please help me guys.
Thanks
Marvin ReidPosted Jan 16, 2024, 5:13 PM
You can compare images by using the DocumentComparer class. Although this doesn't use interop, you can instead bypass the need for having to have Microsoft office installed. Here is some sample code which highlights how you can compare the images as well as a working sample.
https://www.leadtools.com/help/sdk/tutorials/dotnet-winforms-compare-images-with-the-document-comparer.html
https://www.leadtools.com/help/sdk/dh/dc/documentcomparer.html
Mohamed AbedallahPosted May 18, 2017, 12:25 PM
For the first part, there's a good discussion in this forum:
https://forums.asp.net/t/1474743.aspx
Once you are able to obtain the images from the doc files, you can use a professional image processing library like LEADTOOLS to do the comparison. The following article explains some ways of comparing images with a project source code:
https://www.leadtools.com/blog/imaging/image-processing/compare-images-25-projects-25-days/