{"id":26084,"date":"2020-04-14T22:13:54","date_gmt":"2020-04-14T20:13:54","guid":{"rendered":"http:\/\/help.qualiware.it\/qw-help\/?p=26084"},"modified":"2020-04-14T22:14:41","modified_gmt":"2020-04-14T20:14:41","slug":"lettura-dei-valori-dei-campi-di-un-form-pdf","status":"publish","type":"post","link":"https:\/\/help.qualiware.it\/qw-help\/lettura-dei-valori-dei-campi-di-un-form-pdf\/","title":{"rendered":"Lettura dei valori dei campi di un form PDF"},"content":{"rendered":"<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">' Il seguente snippet pu\u00f2 essere utilizzato per leggere i valori dei campi testo e caselle contenuti in un form PDF\r\n' Nell'esempio i valori vengono accodati in un oggetto chiamato \"NOTE\"\r\n' Per ulteriori info vedere qui: https:\/\/help.syncfusion.com\/file-formats\/pdf\/working-with-forms\r\nform.findcontrol(\"NOTE\").value=\"\"\r\n\r\ndim path as string=form.GetDocumentPath()\r\n\r\nDim loadedDocument As New Syncfusion.Pdf.Parsing.PdfLoadedDocument(path)\r\n\r\n' Load the form from the loaded document\r\nDim frm As Syncfusion.Pdf.Parsing.PdfLoadedForm = loadedDocument.Form\r\n\r\n' Load the form field collections from the form\r\nDim fieldCollection As Syncfusion.Pdf.Parsing.PdfLoadedFormFieldCollection = TryCast(frm.Fields, Syncfusion.Pdf.Parsing.PdfLoadedFormFieldCollection)\r\n\r\nFor i As Integer = 0 To fieldCollection.Count - 1\r\n\r\n\tIf TypeOf fieldCollection(i) Is Syncfusion.Pdf.Parsing.PdfLoadedTextBoxField Then\r\n\t\r\n\t\tDim loadedTextBoxField As Syncfusion.Pdf.Parsing.PdfLoadedTextBoxField = TryCast(fieldCollection(i), Syncfusion.Pdf.Parsing.PdfLoadedTextBoxField)\r\n\t\t\r\n\t\tform.findcontrol(\"NOTE\").value+=loadedTextBoxField.name+\"=\"+isnull(loadedTextBoxField.Text,\"\")+chr(13)\r\n\tElse\r\n\t\tif TypeOf fieldCollection(i) Is Syncfusion.Pdf.Parsing.PdfLoadedCheckBoxField\r\n\t\t\tDim loadedCheckBoxField As Syncfusion.Pdf.Parsing.PdfLoadedCheckBoxField = TryCast(fieldCollection(i), Syncfusion.Pdf.Parsing.PdfLoadedCheckBoxField)\r\n\t\t\r\n\t\t\tform.findcontrol(\"NOTE\").value+=loadedCheckBoxField.name+\"=\"+loadedCheckBoxField.Checked.toString()+chr(13)\r\n\t\tElse\r\n\t\t\tif TypeOf fieldCollection(i) Is Syncfusion.Pdf.Parsing.PdfLoadedComboBoxField\r\n\t\t\t\tDim loadedComboBoxField As Syncfusion.Pdf.Parsing.PdfLoadedComboBoxField = TryCast(fieldCollection(i), Syncfusion.Pdf.Parsing.PdfLoadedComboBoxField)\r\n\t\t\t\r\n\t\t\t\tform.findcontrol(\"NOTE\").value+=loadedComboBoxField.name+\"=\"+isnull(loadedComboBoxField.SelectedValue,\"\")+chr(13)\t\r\n\t\t\tEnd If\r\n\t\tEnd If\r\n\tEnd If\r\n\r\nNext i\r\n\r\nloadedDocument.Close(True)\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&#8216; Il seguente snippet pu\u00f2 essere utilizzato per leggere i valori dei campi testo e caselle contenuti in un form PDF &#8216; Nell&#8217;esempio i valori vengono accodati in un oggetto chiamato &#8220;NOTE&#8221; &#8216; Per ulteriori info vedere qui: https:\/\/help.syncfusion.com\/file-formats\/pdf\/working-with-forms form.findcontrol(&#8220;NOTE&#8221;).value=&#8221;&#8221; dim path as string=form.GetDocumentPath() Dim loadedDocument As New Syncfusion.Pdf.Parsing.PdfLoadedDocument(path) &#8216; Load the form from the&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"ngg_post_thumbnail":0,"footnotes":""},"categories":[65],"tags":[71],"acf":[],"_links":{"self":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/26084"}],"collection":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/comments?post=26084"}],"version-history":[{"count":0,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/26084\/revisions"}],"wp:attachment":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/media?parent=26084"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/categories?post=26084"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/tags?post=26084"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}