PDF FlattenFormFields not retaining Comb effect fields
PDF FlattenFormFields not retaining Comb effect fields
Hi there,
I'm currently evaluating GdPicture and find it very powerful and fast. I'm having a small problem with the FlattenFormFields method, however, which is removing Comb field formatting.
Here's a field config in Acrobat (CombFormat.png) When the field value is populated using GdPicture, it looks fine (CombFormat.png) And yet, when the FlattenFormFields method is called, the formatting is lost (FlatFormat.png) I'm evaluating the very latest version of the toolkit (file versino 10.2.0.30), running on .NET 4.0.
Thanks in advance,
Dan
I'm currently evaluating GdPicture and find it very powerful and fast. I'm having a small problem with the FlattenFormFields method, however, which is removing Comb field formatting.
Here's a field config in Acrobat (CombFormat.png) When the field value is populated using GdPicture, it looks fine (CombFormat.png) And yet, when the FlattenFormFields method is called, the formatting is lost (FlatFormat.png) I'm evaluating the very latest version of the toolkit (file versino 10.2.0.30), running on .NET 4.0.
Thanks in advance,
Dan
Re: PDF FlattenFormFields not retaining Comb effect fields
Hi DanZigga
I can not reproduce your problem.
Can you share your Pdf and the code you are using .
Jean-Luc
I can not reproduce your problem.
Can you share your Pdf and the code you are using .
Jean-Luc
Re: PDF FlattenFormFields not retaining Comb effect fields
Hi DanZigga
Problem reproduced! It come with the SetFormFieldValue function, not the with FlattenFormFields
I started investigations and warn you as soon as a fix will be avaible
Jean-Luc
Problem reproduced! It come with the SetFormFieldValue function, not the with FlattenFormFields
I started investigations and warn you as soon as a fix will be avaible
Jean-Luc
Re: PDF FlattenFormFields not retaining Comb effect fields
Hi Jean-Luc,
Thanks for the reply. I havea test PDF (CombForm.pdf) with 3 comb fields on it, however this forum won't let me post it - can I email it to you? Here's a reduced set of code which replicates the problem of a flattened PDF form is losing comb formatting.
An additional problem with the below is that the first field "TEXT1" isn't being populated since the GetFormFieldTitle method is returning a blank for that field.
Thanks,
Dan
Thanks for the reply. I havea test PDF (CombForm.pdf) with 3 comb fields on it, however this forum won't let me post it - can I email it to you? Here's a reduced set of code which replicates the problem of a flattened PDF form is losing comb formatting.
An additional problem with the below is that the first field "TEXT1" isn't being populated since the GetFormFieldTitle method is returning a blank for that field.
Code: Select all
Dim result As GdPicture10.GdPictureStatus = GdPicture10.GdPictureStatus.OK
Dim flattenPDF As Boolean = True 'Set to true to see the problem
Dim fileName As String = "C:\CombForm.PDF"
If IO.File.Exists(fileName) Then
registerGDP() 'licenseManager registerKey done here.
result = gPDF.LoadFromFile(fileName, True)
If result <> GdPicture10.GdPictureStatus.OK Then
MsgBox("Load failed: " & gPDF.GetStat.ToString)
Exit Sub
End If
For i = 1 To gPDF.GetFormFieldsCount
Dim fieldIndex As Integer = gPDF.GetFormFieldID(i)
Select Case gPDF.GetFormFieldTitle(fieldIndex).ToUpper
Case "TEXT1"
result = gPDF.SetFormFieldValue(fieldIndex, "AB123")
Case "TEXT2"
result = gPDF.SetFormFieldValue(fieldIndex, "CD456")
Case "TEXT3"
result = gPDF.SetFormFieldValue(fieldIndex, "EF789")
End Select
If result <> GdPicture10.GdPictureStatus.OK Then
MsgBox("Field value update failed: " & gPDF.GetStat.ToString)
Exit Sub
End If
Next
End If
If flattenPDF Then
result = gPDF.FlattenFormFields()
If result <> GdPicture10.GdPictureStatus.OK Then
MsgBox("Flatten failed: " & gPDF.GetStat.ToString)
Exit Sub
End If
End If
Dim newFileName As String = IO.Path.GetDirectoryName(fileName) & "\" & IO.Path.GetFileNameWithoutExtension(fileName) & "_Merged" & IO.Path.GetExtension(fileName)
result = gPDF.SaveToFile(newFileName)
If result <> GdPicture10.GdPictureStatus.OK Then
MsgBox("Save failed: " & gPDF.GetStat.ToString)
Exit Sub
End If
Dan
Re: PDF FlattenFormFields not retaining Comb effect fields
Thanks for the update, Jean-Luc - I'm glad you've replicated the problem.
Just a note on my code above - there's possibly another slight problem with the GetFormFieldTitle method not returning one of the field names (the first field on the form?). If you could check this form me too please, that would be great.
Regards,
Dan
Just a note on my code above - there's possibly another slight problem with the GetFormFieldTitle method not returning one of the field names (the first field on the form?). If you could check this form me too please, that would be great.
Regards,
Dan
Re: PDF FlattenFormFields not retaining Comb effect fields
Hi
The GetFormFieldID fuction is zero based
your code :
For i = 1 To gPDF.GetFormFieldsCount
Dim fieldIndex As Integer = gPDF.GetFormFieldID(i)
should be :
For i = 0 To gPDF.GetFormFieldsCount - 1
Dim fieldIndex As Integer = gPDF.GetFormFieldID(i)
see the link below.
https://www.gdpicture.com/guides/gdpicture/web ... eldID.html
Concerning the comb aspect, it is fixed. The next minor release will probably containt it.
Jean-Luc
The GetFormFieldID fuction is zero based
your code :
For i = 1 To gPDF.GetFormFieldsCount
Dim fieldIndex As Integer = gPDF.GetFormFieldID(i)
should be :
For i = 0 To gPDF.GetFormFieldsCount - 1
Dim fieldIndex As Integer = gPDF.GetFormFieldID(i)
see the link below.
https://www.gdpicture.com/guides/gdpicture/web ... eldID.html
Concerning the comb aspect, it is fixed. The next minor release will probably containt it.
Jean-Luc
Re: PDF FlattenFormFields not retaining Comb effect fields
Fantastic. I hadn't spotted that the GetFormFieldID is zero-based - whoops.
Good news on the comb field fix. We'll test it with the next minor release.
Thanks,
Dan
Good news on the comb field fix. We'll test it with the next minor release.
Thanks,
Dan
Re: PDF FlattenFormFields not retaining Comb effect fields
Hi there,
Next question (related to this...): How do I now CREATE a comb field using GDPicture? I have a flat PDF that I want to create text fields on, but want to create a comb field (rather than starting off with a PDF form that already has comb fields on it). Is that possible?
Thanks and best regards,
Dan
Next question (related to this...): How do I now CREATE a comb field using GDPicture? I have a flat PDF that I want to create text fields on, but want to create a comb field (rather than starting off with a PDF form that already has comb fields on it). Is that possible?
Thanks and best regards,
Dan
Re: PDF FlattenFormFields not retaining Comb effect fields
Hi DanZigga
Very sorry , there is actually no way to create such field with GdPicture.
Jean-Luc
Very sorry , there is actually no way to create such field with GdPicture.
Jean-Luc
Re: PDF FlattenFormFields not retaining Comb effect fields
Hi Jean-Luc,
Thanks for the response. That's unfortunately a show-stopper for us. Do you know of any workarounds, or do you have any plans to incorporate the ability to create Comb Fields in the near future? We're currently evaluating the software.
Thanks and best regards,
Dan
Thanks for the response. That's unfortunately a show-stopper for us. Do you know of any workarounds, or do you have any plans to incorporate the ability to create Comb Fields in the near future? We're currently evaluating the software.
Thanks and best regards,
Dan
Re: PDF FlattenFormFields not retaining Comb effect fields
Hi DanZigga
I am actually working to proide more functions to handle the form fields.
I an not able to say when this will be distributed, but it's on the way.
The method should be named like this
Public Function SetFormFieldComb( ByVal FieldID As Integer, ByVal UseComb As Boolean)
Jean-Luc
I am actually working to proide more functions to handle the form fields.
I an not able to say when this will be distributed, but it's on the way.
The method should be named like this
Public Function SetFormFieldComb( ByVal FieldID As Integer, ByVal UseComb As Boolean)
Jean-Luc
Re: PDF FlattenFormFields not retaining Comb effect fields
Hi Jean-Luc,
That would be really great if that functionality is in place. I'm currently also a v11 beta tester, so would be happy to assist if you need some real-world tests.
Best regards,
Dan
That would be really great if that functionality is in place. I'm currently also a v11 beta tester, so would be happy to assist if you need some real-world tests.
Best regards,
Dan
Re: PDF FlattenFormFields not retaining Comb effect fields
Hi Jean-Luc,
Do you know if there is any progress on the new method SetFormFieldComb? Let me know if I can assist with testing.
Thanks and best regards,
Dan
Do you know if there is any progress on the new method SetFormFieldComb? Let me know if I can assist with testing.
Thanks and best regards,
Dan
Re: PDF FlattenFormFields not retaining Comb effect fields
Hi DanZigga
I am always on the developpement of a whole set of functions for the formfields. I think it will be finished this week. After that, the code will be submitted for review to the big boss.
If the boss approve the code, it will be included in the beta V11 for tests
So do not expect something before 2 weeks
Jean-Luc
I am always on the developpement of a whole set of functions for the formfields. I think it will be finished this week. After that, the code will be submitted for review to the big boss.
If the boss approve the code, it will be included in the beta V11 for tests
So do not expect something before 2 weeks
Jean-Luc
Re: PDF FlattenFormFields not retaining Comb effect fields
Thanks for the feedback Jean-Luc,
Just another question regarding this. Is there an auto-font size option for PDF form fields?
Thanks and best regards,
Dan
Just another question regarding this. Is there an auto-font size option for PDF form fields?
Thanks and best regards,
Dan
Who is online
Users browsing this forum: No registered users and 1 guest