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!
Weird checkboxes |
Post Reply |
Author | |
dsola
Team Player Joined: 28 Oct 05 Location: Croatia Status: Offline Points: 34 |
Post Options
Thanks(0)
Posted: 20 May 14 at 3:37PM |
I have problem with checkboxes.
Different versions of Quick PDF differently read theirs properties. I used same PDF, same code to read same properties with versions 9.11, 9.13, 9.16 and 10.14. Result are not the same. Does anyone know anything about that? PDF and files are on link: https://drive.google.com/folderview?id=0B2k-Tu8psXwNUEZyNXFKSUd0Tnc&usp=sharing Compare txt file to see differences. Source Code (Part) ---------------------------------------------------------- var ii, nbr : integer; checkBoxIsMultiple, lControlExists : Boolean; tempFieldID : integer; myEnabled : Boolean; myInnerValue, myText, myRealName, myCheckBoxValue : string; BEGIN myPDF := TQuickPDF.Create; myPDF.UnlockKey('xxxxxxxxxxxxxx'); if myPDF.Unlocked = 0 then ShowMessage('Invalid key'); myPDF.LoadFromFile(xxxxxxxxx, ''); for ii := 1 to myPDF.FormFieldCount do if (myPDF.GetFormFieldType(ii) = 4) or (myPDF.GetFormFieldType(ii) = 3) then begin myMemo.Lines.Add('=================================================='); myEnabled := not (myPDF.GetFormFieldReadOnly(ii) = 1); myRealName := myPDF.GetFormFieldDescription(ii); myCheckBoxValue := myPDF.GetFormFieldValue(ii); checkBoxIsMultiple := (myPDF.GetFormFieldSubCount(ii) > 2); myMemo.Lines.Add('Field ID : ' + IntToStr(ii) ); myMemo.Lines.Add('GetFormFieldReadOnly : ' + BoolToStr(myEnabled,true) ); myMemo.Lines.Add('GetFormFieldDescription : ' + myRealName ); myMemo.Lines.Add('GetFormFieldValue : ' + myCheckBoxValue ); for nbr := 1 to myPDF.GetFormFieldSubCount(ii) do begin myInnerValue := myPDF.GetFormFieldSubName(ii, nbr); if (myInnerValue = myCheckBoxValue) then myText := 'X' else myText := ''; myMemo.Lines.Add('................................'); myMemo.Lines.Add(' GetFormFieldSubName: ' + myInnerValue + ' - ' + myText ); if checkBoxIsMultiple then // tempFieldID := myPDF.GetFormFieldSubTempIndex(ii, nbr) // ver. 09.xx tempFieldID := myPDF.GetFormFieldKidTempIndex(ii, nbr) // ver. 10.11 else tempFieldID := ii; myMemo.Lines.Add(' GetFormFieldSubTempIndex : ' + IntToStr(tempFieldID) ); myMemo.Lines.Add(' GetFormFieldDescription : ' + myPDF.GetFormFieldDescription(tempFieldID)); if not checkBoxIsMultiple then myMemo.Lines.Add(' GetFormFieldTitle : ' + myPDF.GetFormFieldTitle(tempFieldID)); myMemo.Lines.Add(' GetFormFieldType : ' + IntToStr(myPDF.GetFormFieldType(tempFieldID))); lControlExists := (myPDF.GetFormFieldBound(tempFieldID, 1) <> 0); myMemo.Lines.Add(' GetFormFieldBound : ' + BoolToStr(lControlExists,true) ); end; end; Edited by dsola - 20 May 14 at 3:41PM |
|
registered QuickPDF user
|
|
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
|
dsola,
There have been many changes and improvements with check boxes in 9.x and 10.xx versions. These change are now complete. They were changed because of inconsistencies in the functions and SubNames were being used instead of KidNames in various places and it needed cleaning up especially when it came to Radio fields. If a field is of type Radio then each item is a Kid and you use the Kid functions to access each button. For each button there are On an Off values and there are the SubNames. For a Choice field the choices are in the SubNames. In previous versions the Kids and SubNames were getting mixed up. I would recommend sticking to one of the more recent versions. Andrew.
|
|
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