Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
New User, VB6 with QuickPDF |
Post Reply
|
| Author | |
SnoopyUK
Beginner
Joined: 04 Apr 11 Location: UK Status: Offline Points: 3 |
Post Options
Thanks(0)
Quote Reply
Topic: New User, VB6 with QuickPDFPosted: 04 Apr 11 at 1:30PM |
|
Hi, I have installed the trial version and am currently trying to get this to work for me. I have a test PDF with 2 pages each with 3 fields on. When I step through my code it finds and populates all the fields but when I view the saved PDF the Qty field is blank and still editable.
Can anyone point out any obvious mistakes? This is the relevant code: qp.LoadFromFile ("C:\Users\Andy\Desktop\testfields.pdf") FFCount = qp.FormFieldCount If FFCount > 0 Then For i = 1 To FFCount fftitle = qp.GetFormFieldTitle(i) If Right(fftitle, 10) = "Project[0]" Then qp.SetNeedAppearances (i) qp.SetFormFieldValue i, "New Project" qp.UpdateAppearanceStream (i) End If If Right(fftitle, 6) = "Qty[0]" Then qp.SetNeedAppearances (i) qp.SetFormFieldValue i, "632" qp.UpdateAppearanceStream (i) End If If Right(fftitle, 7) = "Date[0]" Then qp.SetNeedAppearances (i) qp.SetFormFieldValue i, "04/04/11" qp.UpdateAppearanceStream (i) End If Next i For i = 1 To FFCount qp.FlattenFormField (i) Next i End If qp.SaveToFile "C:\Users\Andy\Desktop\testfields2.pdf" Any help would be greatly appreciated. Thank you
|
|
![]() |
|
AndrewC
Moderator Group
Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 Apr 11 at 2:14PM |
|
When you flatten a form field it reduces the total Form Field count by 1 so the last loop in your code needs to be reversed in order to work properly to allow for the shrinking form field list. For i = FFCount to 1 step -1 ' I haven't programmed Basic in years.... qp.FlattenFormField (i) Next i Andrew. |
|
![]() |
|
jpbro
Senior Member
Joined: 29 Mar 11 Status: Offline Points: 77 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 Apr 11 at 2:14PM |
|
Can you post a link to the test PDF?
|
|
![]() |
|
Rowan
Moderator Group
Joined: 10 Jan 09 Status: Offline Points: 398 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 Apr 11 at 2:20PM |
|
Two possibly issues, one minor, one big:
1. If you're calling SetNeedAppearances then you don't need to call UpdateAppearanceStream. 2. SetNeedAppearances takes 0 (false) or 1 (true), you can't update it with the index. |
|
![]() |
|
SnoopyUK
Beginner
Joined: 04 Apr 11 Location: UK Status: Offline Points: 3 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 Apr 11 at 2:34PM |
![]() But... AndrewC, excellent thank you. works fine now. Very helpful.
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() 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 |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store