{"id":26089,"date":"2020-04-14T22:34:39","date_gmt":"2020-04-14T20:34:39","guid":{"rendered":"http:\/\/help.qualiware.it\/qw-help\/?p=26089"},"modified":"2020-04-14T22:34:39","modified_gmt":"2020-04-14T20:34:39","slug":"scrittura-dei-valori-dei-campi-di-un-form-pdf","status":"publish","type":"post","link":"https:\/\/help.qualiware.it\/qw-help\/scrittura-dei-valori-dei-campi-di-un-form-pdf\/","title":{"rendered":"Scrittura dei valori dei campi di un form PDF"},"content":{"rendered":"<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">' Il seguente snippet pu\u00f2 essere utilizzato come esempio per assegnare i valori ai campi testo e caselle contenuti in un form PDF\r\n' Nell'esempio ai campi testo viene assegnato il nome, mentre le caselle vengono spuntate\r\n' Per ulteriori info vedere qui: https:\/\/help.syncfusion.com\/file-formats\/pdf\/working-with-forms\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\tloadedTextBoxField.Text=loadedTextBoxField.name\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\tloadedCheckBoxField.Checked=true\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\tloadedComboBoxField.SelectedValue=loadedComboBoxField.Name\r\n\t\t\tEnd If\r\n\t\tEnd If\r\n\tEnd If\r\n\r\nNext i\r\n\r\nloadedDocument.Save()\r\nloadedDocument.Close(True)\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&#8216; Il seguente snippet pu\u00f2 essere utilizzato come esempio per assegnare i valori ai campi testo e caselle contenuti in un form PDF &#8216; Nell&#8217;esempio ai campi testo viene assegnato il nome, mentre le caselle vengono spuntate &#8216; Per ulteriori info vedere qui: https:\/\/help.syncfusion.com\/file-formats\/pdf\/working-with-forms dim path as string=form.GetDocumentPath() Dim loadedDocument As New Syncfusion.Pdf.Parsing.PdfLoadedDocument(path) &#8216; Load&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\/26089"}],"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=26089"}],"version-history":[{"count":0,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/26089\/revisions"}],"wp:attachment":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/media?parent=26089"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/categories?post=26089"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/tags?post=26089"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}