Exemple #1
0
        public async Task <IActionResult> GetWebPageAsImage([FromRoute] Int32 version, ImageRequest request)
        {
            try
            {
                var cancel = Request.HttpContext.RequestAborted;
                var shot   = await _shooterManager.ShotImageAsync(request.ToShotOptions(), cancel);

                return(File(shot.Bytes, shot.MimeType, shot.FileName));
            }
            catch (Exception exception)
            {
                _logger.LogError(exception, "Error on getting image screen shot");
                return(StatusCode(500));
            }
        }