Esempio n. 1
0
        public MicrosoftOfficePdfOutOfProcessJob(
            WordConverter wordConverter,
            PowerPointConverter powerPointConverter,
            ExcelConverter excelConverter,
            ILogger logger)
        {
            base.PipelineId = "office";
            base.QueueName = "office";
            _wordConverter = wordConverter;
            _powerPointConverter = powerPointConverter;
            _excelConverter = excelConverter;
            _logger = logger;
            OfficeUtils.Logger = logger;

            //var config = ConfigurationManager.AppSettings["threadNumber"];
            //_logger.InfoFormat("Configuration ThreadNumber is {0}", config);
            //if (String.IsNullOrEmpty(config) || !Int32.TryParse(config, out _threadNumber))
            //{
            //    _logger.Info("Configuration ThreadNumber wrong the job will default to a single thread");
            //    _threadNumber = 1;
            //}

            //It is not safe to have more than one thread running office automation.
            _threadNumber = 1; 

            OfficeUtils.KillStaleOfficeProgram();
            _cleanupTimer = new Timer();
            _cleanupTimer.Elapsed += (s, e) => OfficeUtils.KillStaleOfficeProgram();
            _cleanupTimer.Interval = 1000 * 60 * 10;
            _cleanupTimer.Start();
        }
 public MicrosoftOfficePdfOutOfProcessJob(
     WordConverter wordConverter,
     PowerPointConverter powerPointConverter,
     ExcelConverter excelConverter,
     ILogger logger)
 {
     base.PipelineId      = "office";
     base.QueueName       = "office";
     _wordConverter       = wordConverter;
     _powerPointConverter = powerPointConverter;
     _excelConverter      = excelConverter;
     _logger            = logger;
     OfficeUtils.Logger = logger;
 }