HRESULT AddControlToAction ( LONG actionNumber, LONG controlNumber ) |
{ PDF object is supposed to be created } e1 := PDF.AddEditBox(20, 20, 120, 32, 'field1'); PDF.AnnotUnicodeText := 'Some text'; e2 := PDF.AddEditBox(140, 20, 240, 32, 'field2'); PDF.AnnotUnicodeText := 'Other text'; c1 := PDF.AddCheckBox(250, 20, 262, 32, 'check1'); b1 := PDF.AddButton(180, 60, 240, 80, 'but1'); PDF.AnnotUnicodeCaption := 'Submit'; submit := PDF.CreateSubmitFormAction('http://127.0.0.1', true, smPost); PDF.OnControlMouseUp := submit; b2 := PDF.AddButton(260, 60, 320, 80, 'but2'); PDF.AnnotUnicodeCaption := 'Hide some...'; a_hide := PDF.CreateHideControlAction(); a_show := PDF.CreateShowControlAction(); // Now add needed controls to be hidden/shown on button pressed/released PDF.AddControlToAction(a_hide, e1); PDF.AddControlToAction(a_hide, c1); PDF.AddControlToAction(a_hide, b1); PDF.AddControlToAction(a_show, e1); PDF.AddControlToAction(a_show, c1); PDF.AddControlToAction(a_show, b1); PDF.OnControlMouseDown := a_hide; PDF.OnControlMouseUp := a_show; PDF.SaveToFile('test.pdf', true);
// PDF object is supposed to be created long e1 = PDF->AddEditBox(20, 20, 120, 32, "field1"); PDF->AnnotUnicodeText = L"Some text"; long e2 = PDF->AddEditBox(140, 20, 240, 32, "field2"); PDF->AnnotUnicodeText = L"Other text"; long c1 = PDF->AddCheckBox(250, 20, 262, 32, "check1"); long b1 = PDF->AddButton(180, 60, 240, 80, "but1"); PDF->AnnotUnicodeCaption = L"Submit"; long submit = PDF->CreateSubmitFormAction("http://127.0.0.1", true, smPost); PDF->OnControlMouseUp = submit; long b2 = PDF->AddButton(260, 60, 320, 80, "but2"); PDF->AnnotUnicodeCaption = L"Hide some..."; long a_hide = PDF->CreateHideControlAction(); long a_show = PD->CreateShowControlAction(); // Now add needed controls to be hidden/shown on button pressed/released PDF->AddControlToAction(a_hide, e1); PDF->AddControlToAction(a_hide, c1); PDF->AddControlToAction(a_hide, b1); PDF->AddControlToAction(a_show, e1); PDF->AddControlToAction(a_show, c1); PDF->AddControlToAction(a_show, b1); PDF->OnControlMouseDown = a_hide; PDF->OnControlMouseUp = a_show; PDF->SaveToFile("test.pdf", true);
// PDF object is supposed to be created long e1 = PDF.AddEditBox(20, 20, 120, 32, "field1"); PDF.AnnotUnicodeText = "Some text"; long e2 = PDF.AddEditBox(140, 20, 240, 32, "field2"); PDF.AnnotUnicodeText = "Other text"; long c1 = PDF.AddCheckBox(250, 20, 262, 32, "check1"); long b1 = PDF.AddButton(180, 60, 240, 80, "but1"); PDF.AnnotUnicodeCaption = "Submit"; long submit = PDF.CreateSubmitFormAction("http://127.0.0.1", true, SubmitMethod.smPost); PDF.OnControlMouseUp = submit; long b2 = PDF.AddButton(260, 60, 320, 80, "but2"); PDF.AnnotUnicodeCaption = "Hide some..."; long a_hide = PDF.CreateHideControlAction(); long a_show = PDF.CreateShowControlAction(); // Now add needed controls to be hidden/shown on button pressed/released PDF.AddControlToAction(a_hide, e1); PDF.AddControlToAction(a_hide, c1); PDF.AddControlToAction(a_hide, b1); PDF.AddControlToAction(a_show, e1); PDF.AddControlToAction(a_show, c1); PDF.AddControlToAction(a_show, b1); PDF.OnControlMouseDown = a_hide; PDF.OnControlMouseUp = a_show; PDF.SaveToFile("test.pdf", true);
' PDF object is supposed to be created e1 = PDF.AddEditBox(20, 20, 120, 32, "field1") PDF.AnnotUnicodeText = "Some text" e2 = PDF.AddEditBox(140, 20, 240, 32, "field2") PDF.AnnotUnicodeText = "Other text" c1 = PDF.AddCheckBox(250, 20, 262, 32, "check1") b1 = PDF.AddButton(180, 60, 240, 80, "but1") PDF.AnnotUnicodeCaption = "Submit" submit = PDF.CreateSubmitFormAction("http://127.0.0.1", true, 1) 'SubmitMethod.smPost PDF.OnControlMouseUp = submit b2 = PDF.AddButton(260, 60, 320, 80 ,"but2") PDF.AnnotUnicodeCaption = "Hide some..." a_hide = PDF.CreateHideControlAction() a_show = PDF.CreateShowControlAction() ' Now add needed controls to be hidden/shown on button pressed/released PDF.AddControlToAction a_hide, e1 PDF.AddControlToAction a_hide, c1 PDF.AddControlToAction a_hide, b1 PDF.AddControlToAction a_show, e1 PDF.AddControlToAction a_show, c1 PDF.AddControlToAction a_show, b1 PDF.OnControlMouseDown = a_hide PDF.OnControlMouseUp = a_show PDF.SaveToFile "test.pdf", true