Print Page | Close Window

FormFieldCount Error

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2247
Printed Date: 13 Aug 25 at 5:23PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: FormFieldCount Error
Posted By: JohnTurpin
Subject: FormFieldCount Error
Date Posted: 26 Apr 12 at 4:11PM
I have a PDF with fields which I use as a template.
I use CopyPageRanges to copy it to a new document.
The problem is when I call FormFieldCount on the new doc it returns zero!...the original had 42 fields.

PdfLib.NewDocument();
int ChqsDocID = PdfLib.SelectedDocument();

int i = PdfLib.LoadFromFile(FN, "");
int TemplateDocID = PdfLib.SelectedDocument();
int FldCnt = PdfLib.FormFieldCount(); //42 fields in the template

PdfLib.SelectDocument(ChqsDocID);

i = 1;
while (i <= NumFormsIWant)
{
   PdfLib.CopyPageRanges(TemplateDocID, "1"); //This works
                                   
   int FldCnt2 = PdfLib.FormFieldCount(); //RETURNS ZERO!
                                   
   if (PdfLib.SetFormFieldValueByTitle("FldName", "SomeVal") == 0); //This always fails as it does not recognize the fields yet!

.........
}

Any help would be appreciated



Replies:
Posted By: AndrewC
Date Posted: 03 May 12 at 12:18PM
Which version of QuickPDF Library are you using ?  DLL, ActiveX ?? 8.xx or 7.xx ?

You may need to send the document to the official support forums so that we can test it.  You can uses the following link to submit a new support cast.

http://www.quickpdflibrary.com/support/support-query.php - http://www.quickpdflibrary.com/support/support-query.php

Andrew.


Posted By: JohnTurpin
Date Posted: 03 May 12 at 1:39PM
I am using version 8.13

I am using the dll (QuickPDFDLL0813.dll)

The problem seems to be that the changes are not committed to the PDF until a second operation is performed. For example:
PdfLib.CopyPageRanges(TemplateDocID, "1"); /* Let's call this "First Form". */
/*At this stage the fields on this first form are not available. */

PdfLib.CopyPageRanges(TemplateDocID, "1") ; //Second Form
/* Now the first copy is fully committed and I can access the fields on the First Form. */
....Note: I flatten the fields here...

PdfLib.CopyPageRanges(TemplateDocID, "1") ; //Second Form
/* Now the second copy is fully committed and I can access the fields on the Second Form. */

If there were a "flush" command to force the fields to commit that would solve the problem.

.......then at the end I just delete the extra form. (Note: After setting the fields on the first form I flatten the fields out so that there isn't a name conflict when I add set the fields on the second form.) Just as a matter of interest, is there a way of accessing the fields on each form like Page[1].Fields["FirstField"]  ....   Page[2].Fields["FirstField"]?





Posted By: JohnTurpin
Date Posted: 03 May 12 at 1:40PM



Posted By: JohnTurpin
Date Posted: 03 May 12 at 1:41PM
PS...I will post to the support link you provided.


Posted By: AndrewC
Date Posted: 10 May 12 at 12:59PM
John,

This bug should be fixed in the 8.16 Beta 1 release.  Thanks for reporting it.

Andrew.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk