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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Weird checkboxes
  FAQ FAQ  Forum Search   Register Register  Login Login

Weird checkboxes

 Post Reply Post Reply
Author
Message
dsola View Drop Down
Team Player
Team Player


Joined: 28 Oct 05
Location: Croatia
Status: Offline
Points: 34
Post Options Post Options   Thanks (0) Thanks(0)   Quote dsola Quote  Post ReplyReply Direct Link To This Post Topic: Weird checkboxes
    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
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 26 May 14 at 6:46AM
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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store