Пример #1
0
        /// <inheritdoc />
        public async Task <Stream> CreateImageAsync(string htmlImput, int widthPx, ImageFormat imageFormat, CancellationToken cancellationToken = default)
        {
            await initializeTask;

            using var creator = new ImageCreator(
                      loggerFactory.CreateLogger <ImageCreator>(),
                      depencencyLogger,
                      wkhtmlToImpageExePath,
                      Path.Combine(exectuionDirectory.Directory, Path.GetRandomFileName()),
                      executionTimeout
                      );

            return(await creator.CreateAsync(htmlImput, widthPx, imageFormat, cancellationToken));
        }