1

I have generated the report in PDF format that compares two .DAT files and it works fine and it highlights entire rows which have differences. But now I want to highlight specific change.

Is there anyway that compares the text from pdf and highlights the differences between it???

This is the comparison in listview

This is the comparision in pdf file which highlight entire row but now I want to highlight specific change

mkl
  • 90,588
  • 15
  • 125
  • 265
Dhara Kanala
  • 31
  • 1
  • 5
  • Which PDF libraries do you use now? How do you generate your reports now? What have you tried? – mkl Jan 20 '16 at 12:38
  • I have implemented this using iTextSharp library.and creating document. – Dhara Kanala Jan 21 '16 at 05:11
  • How do you generate your reports now? What have you tried? – mkl Jan 21 '16 at 05:46
  • Very funny. I hoped you would explain how you currently can highlight the whole line with the change but have problems highlighting only the change. As soon as that becomes clear, you have a chance to get a helpful answer. – mkl Jan 21 '16 at 06:34
  • So, you've got code that does "something"... and you want that code to do that "something" better... hmmm... Without seeing the code we can't help too much but I'd look around line 17. – Chris Haas Jan 21 '16 at 14:39
  • I have tried to upload the code in this. but something went wrong.but if you want to see my code this is the link: https://drive.google.com/open?id=0B7neWhQo1Z19X0djYXc0dG5mOEU – Dhara Kanala Jan 22 '16 at 06:02
  • Ok. Do I understand you correctly, for `DiffResultSpanStatus.Replace` you want identical parts of the line to remain unmarked? E.g. in case of your sample line 00001 above, do you want only 'cco' and 'lbe', 'ck' and 'rle', major parts of 'Commissioner of Rev' and 'Director of Finance', some parts of '187' and '1478', 'A' and 'Ri', 'co' and 'h', 'ac' and 'ond', and major parts of '301-0186' and '218-1478' marked? This would mean you first have to compare the letters of those two lines like you compared the lines of those two files and then color smaller `Chunks` accordingly. – mkl Jan 22 '16 at 12:42
  • I have tried it using character by character comparison but it gives some weird behavior. – Dhara Kanala Jan 25 '16 at 05:55

1 Answers1

1

I think you have to try character comparison,but not directly,i have done string comparison but using the replace and to lowercase method,i.e first replace space with "",and lower the strings,then you can go for character comparison,then only result would not be weird.