using inetsoftware.Pdfc; using inetsoftware.Pdfc.Results; using System; using System.Collections.Generic; namespace inetsoftware.PdfcSamples { /// /// A sample to show how to get informations of a difference. /// Expects 2 arguments - the paths of the PDF files /// public class MessageOfDifferences { static MessageOfDifferences() { // Activate the license once from environment if required. string key = Environment.GetEnvironmentVariable("PDFC_KEY"); if (!string.IsNullOrEmpty(key)) { PDFC.ActivateLicense(key); } } /// /// Start the sample, that show the message/text of each difference. /// /// Expected 2 arguments, the path of the PDF files public static void Main(string[] args) { if (args == null || args.Length != 2) { throw new ArgumentException("Usage: "); } PDFComparer pdfComparer = new PDFComparer(); using (ResultModel result = pdfComparer.Compare(args[0], args[1])) { List differences = result.GetDifferences(false); foreach(Diff diff in differences) { System.Console.WriteLine("Message = " + diff.Message); } } } } }