acroforms.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. var doc = new jsPDF();//{unit: 'px'}
  2. doc.setFontSize(12);
  3. doc.text(10, 105, 'ComboBox:');
  4. var d = new ComboBox();
  5. d.T = "ChoiceField1";
  6. d.TI = 1;
  7. d.Rect = [50, 100, 30, 10];
  8. d.Opt = "[(a)(b)(c)]";
  9. d.V = '(b)';
  10. d.DV = '(b)';
  11. doc.addField(d);
  12. doc.text(10, 115, 'ListBox:');
  13. var d2 = new ListBox();
  14. d2.edit = false;
  15. d2.T = "ChoiceField2";
  16. d2.TI = 2;
  17. d2.Rect = [50, 110, 30, 10];
  18. d2.Opt = "[(c)(a)(d)(f)(b)(s)]";
  19. d2.V = '(s)';
  20. d2.BG = [0, 1, 1];
  21. doc.addField(d2);
  22. doc.text(10, 125, 'CheckBox:');
  23. var checkBox = new CheckBox();
  24. checkBox.T = "CheckBox1";
  25. checkBox.Rect = [50, 120, 30, 10];
  26. doc.addField(checkBox);
  27. doc.text(10, 135, 'PushButton:');
  28. var pushButton = new PushButton();
  29. pushButton.T = "PushButton1";
  30. pushButton.Rect = [50, 130, 30, 10];
  31. pushButton.BG = [1, 0, 0];
  32. doc.addField(pushButton);
  33. doc.text(10, 145, 'TextField:');
  34. var textField = new TextField();
  35. textField.Rect = [50, 140, 30, 10];
  36. textField.multiline = true;
  37. textField.V = "The quick brown fox ate the lazy mouse The quick brown fox ate the lazy mouse The quick brown fox ate the lazy mouse";//
  38. textField.T = "TestTextBox";
  39. //textField.Q = 2; // Text-Alignment
  40. doc.addField(textField);
  41. doc.text(10, 155, 'Password:');
  42. var passwordField = new PasswordField();
  43. passwordField.Rect = [50, 150, 30, 10];
  44. doc.addField(passwordField);
  45. doc.text(50, 165, 'RadioGroup:');
  46. var radioGroup = new RadioButton();
  47. radioGroup.V = "/Test";
  48. radioGroup.Subtype = "Form";
  49. doc.addField(radioGroup);
  50. var radioButton1 = radioGroup.createOption("Test");
  51. radioButton1.Rect = [50, 170, 30, 10];
  52. radioButton1.AS = "/Test";
  53. var radioButton2 = radioGroup.createOption("Test2");
  54. radioButton2.Rect = [50, 180, 30, 10];
  55. var radioButton3 = radioGroup.createOption("Test3");
  56. radioButton3.Rect = [50, 190, 20, 10];
  57. radioGroup.setAppearance(AcroForm.Appearance.RadioButton.Cross);