static ScanProcessor()
        {
            // ReSharper disable once RedundantNameQualifier
            var licensePdf = new License();

            licensePdf.SetLicense("Aspose.Total.lic");
            licensePdf.Embedded = true;

            var licenseImaging = new Aspose.Imaging.License();

            licenseImaging.SetLicense("Aspose.Total.lic");
        }
 ///<Summary>
 /// SetAsposeImagingLicense method to Aspose.Words License
 ///</Summary>
 public static void SetAsposeImagingLicense()
 {
     try
     {
         Aspose.Imaging.License acLic = new Aspose.Imaging.License();
         acLic.SetLicense(_licenseFileName);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
Beispiel #3
0
        public ScanProcessor(FileResolution fileResolution, ScansZusammenfassenSettings settings)
        {
            // ReSharper disable once RedundantNameQualifier
            var licensePdf = new License();

            licensePdf.SetLicense("Aspose.Total.lic");

            var licenseImaging = new Aspose.Imaging.License();

            licenseImaging.SetLicense("Aspose.Total.lic");
            this.fileResolution = fileResolution;
            this.settings       = settings;
        }
        protected static void CheckLicense(LicenseProvider provider)
        {
            try
            {
                switch (provider)
                {
                case LicenseProvider.Cells:
                    var license1 = new Aspose.Cells.License();
                    license1.SetLicense(LICENSEPATH);
                    break;

                case LicenseProvider.Diagram:
                    var license2 = new Aspose.Diagram.License();
                    license2.SetLicense(LICENSEPATH);
                    break;

                case LicenseProvider.Pdf:
                    var license3 = new Aspose.Pdf.License();
                    license3.SetLicense(LICENSEPATH);
                    break;

                case LicenseProvider.Slides:
                    var license4 = new Aspose.Slides.License();
                    license4.SetLicense(LICENSEPATH);
                    break;

                case LicenseProvider.Words:
                    var license5 = new Aspose.Words.License();
                    license5.SetLicense(LICENSEPATH);
                    break;

                case LicenseProvider.Tasks:
                    var license6 = new Aspose.Tasks.License();
                    license6.SetLicense(LICENSEPATH);
                    break;

                case LicenseProvider.Imaging:
                    var license7 = new Aspose.Imaging.License();
                    license7.SetLicense(LICENSEPATH);
                    break;
                }
            }
            catch (Exception ex)
            {
                WriteLicenseException(ex);
            }
        }
Beispiel #5
0
        private void InitialLicense(string path)
        {
            //設定License
            string fileName  = path.Split('\\').Last().Split('.')[1];
            string extension = string.Empty;

            extension = fileName.Split('.').Last().ToLower();

            switch (extension)
            {
            case "xls":
            case "xlsx":
                Aspose.Cells.License Excellic = new Aspose.Cells.License();
                Excellic.SetLicense("Aspose.Total.lic");
                break;

            case "doc":
            case "docx":
                // Apply Aspose.Words API License
                Aspose.Words.License Wordlic = new Aspose.Words.License();
                // Place license file in Bin/Debug/Folder
                Wordlic.SetLicense("Aspose.Total.lic");
                break;

            case "tiff":
            case "tif":
            case "png":
            case "gif":
            case "jpeg":
            case "jpg":
            case "xpm":
                Aspose.Imaging.License Imglic = new Aspose.Imaging.License();
                Imglic.SetLicense("Aspose.Total.lic");
                break;

            default:
                break;
            }
        }
Beispiel #6
0
        public static void ImportLicense()
        {
            var asposeLicenseValue = File.ReadAllText("./license.txt");

            if (string.IsNullOrEmpty(asposeLicenseValue))
            {
                return;
            }

            using var stream = new MemoryStream();

            using var write = new StreamWriter(stream);

            write.Write(asposeLicenseValue);
            write.Flush();
            stream.Position = 0;

            var docLicense = new Aspose.Words.License();

            docLicense.SetLicense(stream);

            stream.Position = 0;
            var pdfLicense = new Aspose.Pdf.License();

            pdfLicense.SetLicense(stream);

            stream.Position = 0;
            var imagingLicense = new Aspose.Imaging.License();

            imagingLicense.SetLicense(stream);

            stream.Position = 0;
            var htmlLicense = new Aspose.Html.License();

            htmlLicense.SetLicense(stream);
        }
Beispiel #7
0
 ///<Summary>
 /// SetAsposeImagingLicense method to Aspose.Imaging License
 ///</Summary>
 public static void SetAsposeImagingLicense()
 {
     Aspose.Imaging.License lic = new Aspose.Imaging.License();
     lic.SetLicense("Aspose.Total.lic");
 }