public IEnumerable <ScannedImage> Import(string filePath, ImportParams importParams, Func <int, int, bool> progressCallback)
        {
            if (filePath == null)
            {
                throw new ArgumentNullException(nameof(filePath));
            }
            switch (Path.GetExtension(filePath).ToLowerInvariant())
            {
            case ".pdf":
                return(pdfImporter.Import(filePath, importParams, progressCallback));

            default:
                return(imageImporter.Import(filePath, importParams, progressCallback));
            }
        }
Exemple #2
0
        public ScannedImageSource Import(string filePath, ImportParams importParams, ProgressHandler progressCallback, CancellationToken cancelToken)
        {
            if (filePath == null)
            {
                throw new ArgumentNullException(nameof(filePath));
            }
            switch (Path.GetExtension(filePath).ToLowerInvariant())
            {
            case ".pdf":
                return(pdfImporter.Import(filePath, importParams, progressCallback, cancelToken));

            default:
                return(imageImporter.Import(filePath, importParams, progressCallback, cancelToken));
            }
        }