Comparison of two word doc based on header and footers

Hi,

I want to compare a section of one word document with the section of another based on headers and footers. Is there any direct api aspose provide to do that?

Hi,


Thanks for your inquiry. Unfortunately, there is no API available yet to be able to compare documents. You may use the following code snippet to be able to detect whether particular header/footer of two documents are equal or not:
HeaderFooter hf = doc.getFirstSection().getHeadersFooters().getByHeaderFooterType(HeaderFooterType.HEADER_PRIMARY);
HeaderFooter hf1 = doc1.getFirstSection().getHeadersFooters().getByHeaderFooterType(HeaderFooterType.HEADER_PRIMARY);

String hfString = hf.toString(SaveFormat.TEXT);
String hfString1 = hf1.toString(SaveFormat.TEXT);

System.out.println(hfString.equals(hfString1));

Please let me know if I can be of any further assistance.

Best regards,

Thanks Awais for your reply. I have not checked it yet but curious whether it will take care of things such as tables, paragraphs which can be inside tables or nested tables and things such as font size of the text inside the nested table cell and also the styles of the tables?

Hi,


Thanks for your inquiry. Unfortunately, this is a very simple code which only saves the content (including Tables, Paragraphs) of header/footer in the plain text format irrespective of font size and compares to determine whether the texts of two headers/footers are equal or not. We will inform you via this thread as soon as the comparison API is available. We apologize for your inconvenience.

Best regards,