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!
RadioButtons |
Post Reply |
Author | |
ice_bora
Beginner Joined: 05 Sep 07 Location: Ukraine Status: Offline Points: 7 |
Post Options
Thanks(0)
Posted: 10 Sep 07 at 6:25AM |
I've moved it to this more suitable section ;-) Ingo
Hi all. I have sample code. 1.Create output.pdf file with 2 - checkbox and 3 - radiobutton. 2. Read output.pdf file, select checkboxes and try select radiobutton and save new file. But in new outputres.pdf file checkboxes are checked but radiobuttons empty. I can't select radiobutton !!!! 1) Create pdf file. ..... spPDF->UnlockKey("---") ...... spPDF->NewDocument(); spPDF->SetMeasurementUnits(1); spPDF->SetOrigin(1); spPDF->SetPageSize(_T("A4")); long NormalFont = spPDF->AddStandardFont(4); long BoldFont = spPDF->AddStandardFont(5); long FieldIndex = 0; long SubIndex = 0; spPDF->SelectFont(BoldFont); spPDF->SetTextSize(10); spPDF->DrawTextBox(20,20,100, 5, "Which of these fruit do you like?", 0); spPDF->SelectFont(NormalFont); spPDF->SetTextSize(10); spPDF->DrawTextBox(27, 30, 55, 5, "Orange", 0); FieldIndex = spPDF->NewFormField("LikeOrange", 3); spPDF->SetNeedAppearances(0); spPDF->SetFormFieldBounds(FieldIndex, 20, 30, 60, 5); spPDF->SetFormFieldCheckStyle(FieldIndex, 3, 0); spPDF->DrawTextBox(27, 40, 55, 5, "Peach", 0); FieldIndex = spPDF->NewFormField("LikePeach", 3); spPDF->SetFormFieldBounds(FieldIndex, 20, 40, 60, 5); spPDF->SetFormFieldCheckStyle(FieldIndex, 3, 0); spPDF->SelectFont(BoldFont); spPDF->SetTextSize(10); spPDF->DrawTextBox(20, 60, 100, 5, "Which is your favourite fruit?", 0); FieldIndex = spPDF->NewFormField("FruitChoice", 4); SubIndex = spPDF->AddFormFieldSub(FieldIndex, "Banana"); spPDF->DrawTextBox(27, 70, 55, 5,"Banana", 0); spPDF->SetFormFieldBounds(SubIndex, 20, 70, 60, 5); spPDF->SetFormFieldCheckStyle(SubIndex, 4, 0); SubIndex = spPDF->AddFormFieldSub(FieldIndex, "Apple"); spPDF->DrawTextBox(27, 80, 55, 5,"Appleeee", 0); spPDF->SetFormFieldBounds(SubIndex, 20, 80, 60, 5); spPDF->SetFormFieldCheckStyle(SubIndex, 4, 0); SubIndex = spPDF->AddFormFieldSub(FieldIndex, "Grapes"); spPDF->DrawTextBox(27, 90, 55, 5,"Grapes", 0); spPDF->SetFormFieldBounds(SubIndex, 20, 90, 60, 5); spPDF->SetFormFieldCheckStyle(SubIndex, 4, 0); hr= spPDF->SaveToFile("C:\\output.pdf");//save the file to disk 2). Read file and mark checkbox as checked (work) and try select radiobutton. ........ spPDF->LoadFromFile("C:\\output.pdf");//load a local file long s = spPDF->FormFieldCount(); for (int index=1; index<=s; index++) { long type = spPDF->GetFormFieldType(index); if (type == 3) // checkbox { _bstr_t val = spPDF->GetFormFieldValue(index); spPDF->SetFormFieldValue(index, "Yes"); } if (type == 4) // radiobutton { long chd = spPDF->GetFormFieldSubCount(index); long chd2 = spPDF->GetFormFieldKidCount(index); for (int i=1; i<=chd2; i++) { _bstr_t sub_name = spPDF->GetFormFieldSubName(index,i); long subindex = spPDF->GetFormFieldSubTempIndex(index,i); long chd3 = spPDF->GetFormFieldKidCount(subindex); long sub_type = spPDF->GetFormFieldType(subindex); spPDF->SetFormFieldValue(subindex, "Yes"); } } } spPDF->SaveToFile("C:\\output_result.pdf");//save the file to disk Edited by Ingo - 10 Sep 07 at 4:04PM |
|
ice_bora
Beginner Joined: 05 Sep 07 Location: Ukraine Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Hi.
I can't select radiobutton. Search in all forums, read reference guide and can't find !!!! Help me somebody. |
|
ice_bora
Beginner Joined: 05 Sep 07 Location: Ukraine Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Hi again.
Maybe it doesn't work and I try do impossible. |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi!
Only an idea how to go on ... You're calling the functions... get the resulting values... and working with these values. Perhaps it's better to check the returning values first - so you know where the first error appears. Good luck, Ingo |
|
ice_bora
Beginner Joined: 05 Sep 07 Location: Ukraine Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Hi.
I had holiday and now return to radiobuttons again. 1. I have field with type radiobutton (type = 4) and 3 subfields in this field. 2. long chld = spPDF->GetFormFieldKidCount(indexField); get child count = 3; 3. for (long i =1; i<=chld; i++) { long subindex = spPDF->GetFormFieldSubTempIndex(indexField, i); _bstr_t subName = spPDF->GetFormFieldSubName(indexField, i); long typeSub = spPDF->GetFormFieldType(subindex); } subindex is like us 1426064130 number. typeSub = 4 - radiobutton too. First subName is "Off" why ? What is the subField ? And next are correct names but needs use chld+1 for get last field ? I can change text, style for subFields. spPDF->SetFormFieldCheckStyle(subindex, 1, 0); But I can't do select for one subField !!!!! long res = spPDF->SetFormFieldValue(subindex, "Yes"); Who did something like, help me please. Pasha. |
|
ice_bora
Beginner Joined: 05 Sep 07 Location: Ukraine Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Hi Ingo.
I check return values. But subfield doesn't has value, title and when I setValue return result 0. May be needs use iSEDQuickPDF.dll but problem with registration dll. I use iSED.dll for VC++. It's correct ? Pasha. Edited by ice_bora - 26 Sep 07 at 5:55AM |
|
ice_bora
Beginner Joined: 05 Sep 07 Location: Ukraine Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Hi all.
My monologue continuing ))). Needs set default value to the field, value is one from subfields. spPDF->setFormFieldDefaultValue(indexField, "one from subfields)"; Pasha. |
|
marian_pascalau
Debenu Quick PDF Library Expert Joined: 28 Mar 06 Location: Germany Status: Offline Points: 278 |
Post Options
Thanks(0)
|
Hi there, send a small program + PDF to support(at)quickpdf.org and I will take a look on your problem. And of course that with program I mean source code. C++, Delphi, C#, VB.NET are ok for me.
Best regards, Marian Edited by marian_pascalau - 28 Sep 07 at 2:53AM |
|
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