I have twp pdfs.I want to compare it.For that i converts 2 pdf into 2 lists.I want to compare the 2 lists and export the difference as 2 columns in excel.Could you please help me to find the c# code for it?Please find the below incomplete code?
public static void CompareTwoPDF(string FirstPDF, string SecondPDF)
{
if (File.Exists(FirstPDF) && File.Exists(SecondPDF))
{
PdfReader reader = new PdfReader(SecondPDF);
for (int page = 1; page <= reader.NumberOfPages; page++)
{
ITextExtractionStrategy strategy = new SimpleTextExtractionStrategy();
FirstFile += PdfTextExtractor.GetTextFromPage(reader, page, strategy);
}
PdfReader reader1 = new PdfReader(FirstPDF);
for (int page = 1; page <= reader.NumberOfPages; page++)
{
ITextExtractionStrategy strategy = new SimpleTextExtractionStrategy();
SecondFile += PdfTextExtractor.GetTextFromPage(reader1, page, strategy);
}
}
else
{
Console.WriteLine("Files does not exist.");
}
List File1diff;
List File2diff;
IEnumerable file1 = FirstFile.Trim().Split('\r', '\n');
IEnumerable file2 = SecondFile.Trim().Split('\r', '\n');
File1diff = file1.ToList();
File2diff = file2.ToList();
}
}
}
}
Vidhu SPosted Aug 26, 2020, 8:20 AM
Laxmidhar SahooPosted Jul 26, 2020, 10:21 PM
Vidhu SPosted Jul 26, 2020, 6:42 AM
anoop gsPosted Mar 19, 2020, 2:37 AM
Laxmidhar SahooPosted Mar 19, 2020, 12:29 AM