public static void Run()
        {
            try
            {
                // ExStart:GetButtonOptionValue
                // The path to the documents directory.
                string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

                // Create Form Object
                Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form();

                // Open Document
                pdfForm.BindPdf(dataDir + "FormField.pdf");

                // Get button option values
                var optionValues = pdfForm.GetButtonOptionValues("Gender");

                IDictionaryEnumerator optionValueEnumerator = optionValues.GetEnumerator();

                while (optionValueEnumerator.MoveNext())
                {
                    Console.WriteLine("Key : {0} , Value : {1} ", optionValueEnumerator.Key, optionValueEnumerator.Value);
                }
                // ExEnd:GetButtonOptionValue
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        public static void Run()
        {
            try
            {
                // ExStart:GetButtonOptionValue
                // The path to the documents directory.
                string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

                // Create Form Object
                Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form();

                // Open Document
                pdfForm.BindPdf(dataDir + "FormField.pdf");

                // Get button option values
                var optionValues = pdfForm.GetButtonOptionValues("Gender");

                IDictionaryEnumerator optionValueEnumerator = optionValues.GetEnumerator();

                while (optionValueEnumerator.MoveNext())
                    Console.WriteLine("Key : {0} , Value : {1} ", optionValueEnumerator.Key, optionValueEnumerator.Value);
                // ExEnd:GetButtonOptionValue
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Exemplo n.º 3
0
        public DocsPaVO.ProfilazioneDinamica.Templates PopolaTemplateIstanzaProcedimenti(string idTemplate)
        {
            logger.Debug("BEGIN");
            logger.Debug("Ricerca tipologia fascicolo");
            DocsPaVO.ProfilazioneDinamica.Templates template = BusinessLogic.ProfilazioneDinamica.ProfilazioneFascicoli.getTemplateFascById(idTemplate);
            if (template != null && !string.IsNullOrEmpty(template.ID_TIPO_FASC))
            {
                // Caricamento licenza
                //DocsPaDB.Query_DocsPAWS.ClientSideModelProcessor csmp = new DocsPaDB.Query_DocsPAWS.ClientSideModelProcessor();

                //Aspose.Pdf.License lic = new License();
                //byte[] licenseContent = csmp.GetLicense("ASPOSE");
                //if (licenseContent != null)
                //{
                //    System.IO.MemoryStream licenseStream = new System.IO.MemoryStream(licenseContent, 0, licenseContent.Length);
                //    lic.SetLicense(licenseStream);
                //    licenseStream.Close();
                //}

                // Caricamento file pdf da byte array
                //MemoryStream ms = new MemoryStream(pdfContent);
                //Form form = new Form();
                //form.BindPdf(ms);

                // Ricerca e popolamento dei campi profilati
                foreach (DocsPaVO.ProfilazioneDinamica.OggettoCustom ogg in template.ELENCO_OGGETTI)
                {
                    if (form.FieldNames.Contains(ogg.DESCRIZIONE))
                    {
                        string value = string.Empty;
                        switch (form.GetFieldType(ogg.DESCRIZIONE))
                        {
                        case FieldType.Text:
                            value = form.GetField(ogg.DESCRIZIONE);
                            if (!string.IsNullOrEmpty(value))
                            {
                                ogg.VALORE_DATABASE = value;
                            }
                            break;

                        case FieldType.ComboBox:
                            value = form.GetField(ogg.DESCRIZIONE);
                            if (!string.IsNullOrEmpty(value))
                            {
                                ogg.VALORE_DATABASE = value;
                            }
                            break;

                        case FieldType.CheckBox:
                            value = form.GetField(ogg.DESCRIZIONE);
                            break;

                        case FieldType.Radio:
                            value = form.GetButtonOptionCurrentValue(ogg.DESCRIZIONE);
                            var options = form.GetButtonOptionValues(ogg.DESCRIZIONE);
                            break;

                        default:
                            break;
                        }
                    }
                }
            }
            else
            {
                logger.Debug("Tipologia non trovata");
                template = null;
            }

            logger.Debug("END");
            return(template);
        }