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

            Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form();
            // Open Document
            pdfForm.BindPdf(dataDir + "input.pdf");

            // Get field value
            Console.WriteLine("Field Value : {0} ", pdfForm.GetField("textfield"));
            // ExEnd:GetFieldValue
        }
Esempio n. 2
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);
        }