Example #1
0
        public static void SetPageControlsToCanvas(PDFPageItem page, ImageViewer imageViewer)
        {
            imageViewer.Controls.Clear();

            foreach (FormFieldControl formFieldControl in page.FormControls)
            {
                imageViewer.Controls.Add(formFieldControl);
            }
        }
Example #2
0
        private void SetViewerImage(PDFPageItem item)
        {
            // Scroll Home.
            _imageViewer.ScrollOffset = new LeadPoint(0, 0);

            if (_miViewUseSVGMode.Checked)
            {
                _imageViewer.ActiveItem.SvgDocument = item.PageSVG;
            }
            else
            {
                _imageViewer.ActiveItem.Image = item.PageImage;
            }
        }
Example #3
0
        public static void LoadFormsFieldsFromXML(string xmlFileName, PDFDocument document, ImageViewer imageList)
        {
            FormFieldControl.FormFieldsToolTip.RemoveAll();

            List <XMLDocumentPage> pages = PDFFormsSerializationManager.LoadXML(xmlFileName);

            for (int i = 0; i < pages.Count; i++)
            {
                PDFPageItem page = imageList.Items[i] as PDFPageItem;

                page.FormFields = pages[i].FormFields;

                // Check if the document has forms.
                if (!HasForms && pages[i].FormFields != null && pages[i].FormFields.Count > 0)
                {
                    _hasForms = true;
                }

                page.FormControls = ToFormControls(pages[i].FormFields, document.Resolution);
            }
        }
Example #4
0
        public static void LoadPDFDocument(RasterCodecs codecs, PDFDocument document, ImageViewer imageList)
        {
            _hasForms = false;

            imageList.BeginUpdate();

            imageList.Items.Clear();

            document.ParsePages(PDFParsePagesOptions.FormFields, 1, -1);

            for (int i = 0; i < document.Pages.Count; i++)
            {
                PDFPageItem page = new PDFPageItem();
                // Set page image to use as thumb image
                page.Image = document.GetPageImage(codecs, i + 1);
                // Set page SVG document.
                page.PageSVG = document.GetPageSvg(codecs, i + 1, new CodecsLoadSvgOptions()) as SvgDocument;
                page.PageSVG.OptimizeView();
                // Set page Raster image.
                page.PageImage = document.GetPageImage(codecs, i + 1);
                // Set page number.
                page.PageNumber = i + 1;
                // Set Form Field Associated with this page
                page.FormFields = document.Pages[i].FormFields;

                // Check if the document has forms.
                if (!_hasForms && document.Pages[i].FormFields != null && document.Pages[i].FormFields.Count > 0)
                {
                    _hasForms = true;
                }

                page.FormControls = PDFFormContolsHelper.FormFieldsToControls(document.Pages[i].FormFields, document.Resolution);

                imageList.Items.Add(page);
            }

            imageList.EndUpdate();
        }