logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
jferris  
#1 Posted : Monday, May 29, 2017 4:12:09 AM(UTC)
jferris

Rank: Newbie

Groups: Registered
Joined: 5/29/2017(UTC)
Posts: 2
Ireland

Hi,

I'm using pdfium on WinForms.
I have created a PDF which contains form fields.
First I copy the template to a new filename.
I load the file using LoadDocument() and it displays correctly
I then fill in all of the form fields by typing into them and I click Save.
A save method is then called which saves the PDF back to the file .Save(SaveFlags.NoIncremental)
However, not all of my changes are being saved back (e.g. the last field remains empty even though I entered text into it before saving).
Can you advise the correct methods I should be using for this scenario?

Thanks,
Joe
Paul Rayman  
#2 Posted : Monday, May 29, 2017 4:34:51 PM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
Could you please provide me that pdf file
jferris  
#3 Posted : Monday, May 29, 2017 11:24:22 PM(UTC)
jferris

Rank: Newbie

Groups: Registered
Joined: 5/29/2017(UTC)
Posts: 2
Ireland

Hi Paul,
I think I've just figured out a workaround to resolve this issue.
On further testing it seems that it's always the last form field that doesn't get saved.
However, this only happens if I leave the cursor in this field when clicking save.
If I manually click into some other field it works.
I found a method in the API that seems to do this without the user needing to click away from the last field - Document.FormFill.ForceToKillFocus()
If I call this method before the Save() all seems to be OK.

Thanks,
Joe
Paul Rayman  
#4 Posted : Tuesday, May 30, 2017 2:03:56 PM(UTC)
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
the changes in a field are applied when the field loses a focus. so you should click to another field or call ForceToKillFocus method to apply the changes before saving.

Edited by user Tuesday, May 30, 2017 2:04:33 PM(UTC)  | Reason: Not specified

Users browsing this topic
Guest (2)
Forum Jump  
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.