Пример #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            LicenseManager.AddLicenseData("40AGN-XTOUK-U9O74-3C1JQ-EOEHX");
            Console.WriteLine("Uid:" + LicenseManager.Uid);
            //string path = @"C:\Users\goddi\Downloads\10.1中标通知书.pdf";
            //string path = @"C:\Users\goddi\myspace\书\【JavaScript高级程序设计(第3版)】中文 高清 .pdf";
            var files = Directory.EnumerateFiles(@"C:\Users\goddi\Downloads\", "*.pdf");

            foreach (var file in files)
            {
                Process(file);
            }
        }
Пример #2
0
        public static void Main()
        {
            LicenseManager.AddLicenseData("4O2QO-V13H3-3GO82-F08IH-BVMLQ");


            var applicantStudents = ExcellFileOperations.GetApplicantStudentsFromExcel();

            CreateApplicantForm(applicantStudents);

            var classroomList = ClassroomOperations.GetClassesWithApplicants(applicantStudents);

            CreateClassroomParticipantsForm(classroomList);

            //CreateClassroomParticipantsForm(ClassroomOperations.GetClassesWithApplicants(applicantStudents));


            Console.WriteLine("İşlem bitti...");
        }
Пример #3
0
        public static void PDFToImage(string path, string savePath, string extension)
        {
            // replace string.Empty with your license key
            LicenseManager.AddLicenseData(LicenceKey);

            using (PdfDocument pdf = new PdfDocument(path))
            {
                PdfDrawOptions options = PdfDrawOptions.Create();
                options.BackgroundColor = new PdfRgbColor(255, 255, 255);
                options.Compression     = ImageCompressionOptions.CreateJpeg();
                var index = 1;
                foreach (var pdfPage in pdf.Pages)
                {
                    var fileName = savePath + "-" + index++ + extension;
                    pdfPage.Save(fileName, options);
                }
            }
        }
Пример #4
0
        public static async Task <List <Stream> > PDFToImage(string path)
        {
            // replace string.Empty with your license key
            LicenseManager.AddLicenseData(LicenceKey);

            return(await Task.Run(() =>
            {
                var streamList = new List <Stream>();
                using (PdfDocument pdf = new PdfDocument(path))
                {
                    PdfDrawOptions options = PdfDrawOptions.Create();
                    options.BackgroundColor = new PdfRgbColor(255, 255, 255);
                    options.Compression = ImageCompressionOptions.CreateJpeg();
                    foreach (var page in pdf.Pages)
                    {
                        var outputStream = new MemoryStream();
                        page.Save(outputStream, options);
                        streamList.Add(outputStream);
                    }
                }
                return streamList;
            }));
        }
Пример #5
0
 public PdfService(
     IOptionsMonitor <RecognizeOptions> recognizeOptions)
 {
     LicenseManager.AddLicenseData(recognizeOptions.CurrentValue.LicenceKey);
 }