private void Capture_Captured(object sender, WebPageCapturedEventArgs e) {
            var file = e.CapturedFile;

            using (var fileStream = file.Open(FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) {
                var content = new MakuraContentStream();
                content.FileName = file.Name;
                content.Length = fileStream.Length;
                content.MimeType = MimeMapping.GetMimeMapping(file.Name);
                content.Stream = fileStream;

                var doc = new MakuraDocument();
                doc.ContentStream = content;
                doc.Name = file.Name;

                var eventArgs = new MakuraDocumentEventArgs();
                eventArgs.UpdatedDocument = doc;
                eventArgs.Path = "/CaptureImages";

                Changed?.Invoke(this, eventArgs);
            }
        }
        void webBrowserDocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            //Set the Width and Height of the browser to match the page size acording to the scroll bars
            int webPageHeight = browser.Document.Body.ScrollRectangle.Height;
            int webPageWidth = browser.Document.Body.ScrollRectangle.Width;

            try {
                using (var bmp = new Bitmap(webPageWidth, webPageHeight)) {
                    browser.Size = new Size(webPageWidth, webPageHeight);

                    //Hide scroll bars so they wont show in the image capture
                    browser.ScrollBarsEnabled = false;

                    //capture the image from browser
                    browser.DrawToBitmap(bmp, new Rectangle(browser.Location.X, browser.Location.Y, webPageWidth, webPageHeight));

                    //save image
                    var tempPath = Path.Combine(Path.GetTempPath(), "\\CaptureImage-" + DateTime.Now.ToString("yyyyMMdd-HHmm") + ".jpg");
                    bmp.Save(tempPath, System.Drawing.Imaging.ImageFormat.Jpeg);
                }

                var capturedFile = new FileInfo(saveLocation);
                var args = new WebPageCapturedEventArgs(capturedFile, new Uri(this.CaptureURL));
                Captured?.Invoke(this, args);
            } catch {

            }
        }