Print Page | Close Window

checkbox creation

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=1387
Printed Date: 05 Apr 26 at 12:09AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: checkbox creation
Posted By: pallavi
Subject: checkbox creation
Date Posted: 25 Mar 10 at 10:17AM
how to create checked chekbox?
i have read functions but i m not getting which functions to be used for creation of chekbox?



Replies:
Posted By: Ingo
Date Posted: 26 Mar 10 at 6:42AM
Hi Pallavi!

Please read here:
http://www.quickpdflibrary.com/help/quickpdf/FormFields.php
Have a look at SetForm...

Cheers and welcome here,
Ingo



Posted By: pallavi
Date Posted: 26 Mar 10 at 6:46AM
hello,
i have used following code but it doesn'r create checkbox marked with checked

        $iDf6 = $qp->NewFormField("male", 3);
            $qp->SetFormFieldValue($iDf6, "1");
            $qp->SetNeedAppearances(1);
            $qp->SetFormFieldCheckStyle($iDf6,1,1);


Posted By: Rowan
Date Posted: 26 Mar 10 at 6:49AM
Have you tried setting the border color as well using SetFormFieldBorderColor? If you don't give the check box form field a border color, it will be white and not visible...

Something like the below for a black border:

$iDf6 = $qp->NewFormField("male", 3);
$qp->SetFormFieldValue($iDf6, "1");
$qp->SetFormFieldCheckStyle($iDf6,1,1);
$qp->SetFormFieldCheckStyle($iDf6,0,0,0);
$qp->SetNeedAppearances(1);


Posted By: pallavi
Date Posted: 26 Mar 10 at 10:27AM
hello,
i have tried as yu said but still it doesn't create chekbox pls help me to figure out this code

$iDf6 = $qp->NewFormField("male", 3);
            $qp->SetFormFieldValue($iDf6, "1");
            $qp->SetFormFieldCheckStyle($iDf6,1,1);
            $qp->SetFormFieldBorderColor($iDf6,0,0,0);
            $qp->SetNeedAppearances(1);


Posted By: Rowan
Date Posted: 26 Mar 10 at 7:37PM
Actually, I missed another problem with your original code. You need to use the SetFormFieldBounds function to set the location of the check box on the page as well as the height and width of the check box, without calling this function, nothing will be drawn onto the page.

So this should work:

$iDf6 = $qp->NewFormField("male", 3);
$qp->SetFormFieldValue($iDf6, "1");
$qp->SetFormFieldBounds($iDf6, 100, 400, 23, 23);
$qp->SetFormFieldCheckStyle($iDf6,1,1);
$qp->SetFormFieldBorderColor($iDf6,0,0,0);
$qp->SetNeedAppearances(1);

The SetFormFieldValue function can be used to turn on or off the check box (i.e. check, uncheck).

Turn On
$qp->SetFormFieldValue($iDf6, "Yes");

Turn Off
$qp->SetFormFieldValue($iDf6, "No");

Hope this helps!


Posted By: pallavi
Date Posted: 29 Mar 10 at 6:03AM
Hello,
Thanks very much for your help.
it successfully create checkbox.



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