Exemplo n.º 1
0
        private static Comparer CompareFiles(CompareRequest compareRequest, string resultGuid)
        {
            string firstPath  = compareRequest.guids[0].GetGuid();
            string secondPath = compareRequest.guids[1].GetGuid();

            // create new comparer
            Comparer comparer = new Comparer(firstPath, GetLoadOptions(compareRequest.guids[0].GetPassword()));

            comparer.Add(secondPath, GetLoadOptions(compareRequest.guids[1].GetPassword()));
            CompareOptions compareOptions = new CompareOptions {
                CalculateCoordinates = true
            };

            if (Path.GetExtension(resultGuid) == ".pdf")
            {
                compareOptions.DetalisationLevel = DetalisationLevel.High;
            }

            using (FileStream outputStream = File.Create(Path.Combine(resultGuid)))
            {
                comparer.Compare(outputStream, compareOptions);
            }

            return(comparer);
        }