Logo
My Account |  Site Map | Contact Us  
Welcome Guest Search | Active Topics | Sign In | Register

failed to set a Value to a PdfComboBoxField in a Pdf-Form Options
Josh
Posted: Friday, May 10, 2019 3:46:28 AM
Rank: Newbie
Groups: Member

Joined: 5/10/2019
Posts: 1
Hi,

I tried to set a Value to a PdfComboBoxField in a Pdf-Form:

Code: Visual Basic.NET
Public Function SetzePdfFormularFelder(strPdfVorlageDatei As String,
                                         strPdfAusgabeDatei As String,
                                         dicFelder As Dictionary(Of String, String)
                                        ) As Boolean
    Try
      Dim doc As New PdfDocument(strPdfVorlageDatei)
      For Each fld In doc.Fields
        If dicFelder.ContainsKey(fld.FullName) Then
          fld.Value = dicFelder(fld.FullName)
          fld.Modified()
        End If
      Next
      doc.Save(strPdfAusgabeDatei)
      Return True
    Catch ex As Exception
      ProtokolliereFehler(ex)
      Throw
    End Try
  End Function

For all PdfTextField´s it works. But to set the value in an ComboBox will be ignored. So in a second way, I tried
to set the SelectedIndex. But it won´t be saved anymore:

Code: Visual Basic.NET
For Each fld In doc.Fields
  Select Case True
    Case TypeOf fld Is EO.Pdf.PdfComboBoxField
      Dim fldListField As EO.Pdf.PdfComboBoxField
      fldListField = TryCast (fld, EO.Pdf.PdfComboBoxField)
      fldListField.SelectedIndex = 6
      fldListField.Modified()
    Case Else
      fld.Value = dicFelder(fld.FullName)
      fld.Modified()
End Select

I tried the same with an other library from a other manufacturer with that same PDF and it works.

The librarys, I tried are EO.Total.2019.0.83.0.msi and EO.Total.2019.1.25.0.msi.


Best regards

Josh
eo_support
Posted: Friday, May 10, 2019 10:25:21 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 21,434
Hi,

Can you send both the original PDF file and the PDF file you have successfully modified with other libraries to us? We can look into both files and compare it with file generated by our library and see if we can find out the root of the problem. See here for our email address:

https://www.essentialobjects.com/forum/test_project.aspx

Thanks!
eo_support
Posted: Wednesday, May 15, 2019 11:29:16 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 21,434
Hi,

This is just to let you know that we have received the file and found the root of the problem. This will be fixed in our next build. We will let you know as soon as the new build is available.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.