public static DocumentArea GetScreenToImageRectangle(AxMODI.AxMiDocView viewer, Rectangle screenRectangle)
        {
            int          viewPage = 0;
            DocumentArea context  = new DocumentArea();

            Rectangle viewTarget = DocumentViewerSupport.GetScreenToImageRectangle(viewer, screenRectangle, out viewPage);

            context.Area = viewTarget;
            context.Page = viewPage;

            return(context);
        }
        private void AdjustExtractorFrame()
        {
            InitExtractionFrame();
            try
            {
                _ExtractionFrame.UpdateTableRequestByFrame();
            }
            catch (DocumentAreaException exc)
            {
            }
            Rectangle selection = DocumentViewerSupport.GetImageSelectionAreaToScreen(axMiDocView1);

            if (selection.IsEmpty)
            {
                MessageBox.Show("Please select an area!");
                return;
            }
            _ExtractionFrame.AdjustFrameToTarget(selection);
            _ExtractionFrame.AdjustColumnsToRequest();
            _ExtractionFrame.BringToFront();
            _ExtractionFrame.Show();
            CaptureContent();
        }