Home | History | Annotate | Download | only in javascript
      1 {{header}}
      2 {{object 1 0}} <<
      3   /Type /Catalog
      4   /Pages 2 0 R
      5   /OpenAction 10 0 R
      6 >>
      7 endobj
      8 {{object 2 0}} <<
      9   /Type /Pages
     10   /Count 1
     11   /Kids [
     12     3 0 R
     13   ]
     14 >>
     15 endobj
     16 % Page number 0.
     17 {{object 3 0}} <<
     18   /Type /Page
     19   /Parent 2 0 R
     20   /Resources <<
     21     /Font <</F1 15 0 R>>
     22   >>
     23   /Contents [21 0 R]
     24   /MediaBox [0 0 612 792]
     25 >>
     26 % OpenAction action
     27 {{object 10 0}} <<
     28   /Type /Action
     29   /S /JavaScript
     30   /JS 11 0 R
     31 >>
     32 endobj
     33 % JS program to exexute
     34 {{object 11 0}} <<
     35 >>
     36 stream
     37 
     38 function doTest(name, props) {
     39   try {
     40     for (var i = 0; i < props.length; ++i) {
     41       var expr = name + "." + props[i];
     42       app.alert(expr + " is " + eval(expr));
     43     }
     44   } catch (e) {
     45     app.alert("ERROR: " + e.toString());
     46   }
     47 }
     48 
     49 function doGlobalTest(props) {
     50   try {
     51     for (var i = 0; i < props.length; ++i) {
     52       app.alert(props[i] + " is " + eval(props[i]));
     53     }
     54   } catch (e) {
     55     app.alert("ERROR: " + e.toString());
     56   }
     57 }
     58 
     59 function doGlobalArrayTest(props) {
     60   try {
     61     for (var i = 0; i < props.length; ++i) {
     62       app.alert(props[i] + " is\n  " + eval(props[i]).join(",\n  "));
     63     }
     64   } catch (e) {
     65     app.alert("ERROR: " + e.toString());
     66   }
     67 }
     68 
     69 
     70 try {
     71   doTest("border", ["s", "b", "d", "i", "u", "nonesuch"]);
     72   doTest("display", ["visible", "hidden", "noPrint", "noView", "nonesuch"]);
     73   doTest("font", ["Times", "TimesB", "TimesI", "TimesBI", "Helv", "HelvB",
     74                   "HelvI", "HelvBI", "Cour", "CourB", "CourI", "CourBI",
     75                   "Symbol", "ZapfD", "Nonesuch"]);
     76 
     77   doTest("highlight", ["n", "i", "p", "o", "nonesuch"]);
     78   doTest("position", ["textOnly", "iconOnly", "iconTextV", "textIconV",
     79                       "iconTextH", "textIconH", "overlay", "nonesuch"]);
     80 
     81   doTest("scaleHow", ["proportional", "anamorphic", "nonesuch"]);
     82   doTest("scaleWhen", ["always", "never", "tooBig", "tooSmall", "nonesuch"]);
     83   doTest("style", ["ch", "cr", "di", "ci", "st", "sq", "nonesuch"]);
     84   doTest("zoomtype", ["none", "fitP", "fitW", "fitH", "fitV", "pref", "refW",
     85                       "nonesuch"]);
     86 
     87   doGlobalTest([
     88     "IDS_GREATER_THAN",
     89     "IDS_GT_AND_LT",
     90     "IDS_LESS_THAN",
     91     "IDS_INVALID_MONTH",
     92     "IDS_INVALID_DATE",
     93     "IDS_INVALID_VALUE",
     94     "IDS_AM",
     95     "IDS_PM",
     96     "IDS_MONTH_INFO",
     97     "IDS_STARTUP_CONSOLE_MSG"
     98   ]);
     99 
    100   doGlobalArrayTest([
    101     "RE_NUMBER_ENTRY_DOT_SEP",
    102     "RE_NUMBER_COMMIT_DOT_SEP",
    103     "RE_NUMBER_ENTRY_COMMA_SEP",
    104     "RE_NUMBER_COMMIT_COMMA_SEP",
    105     "RE_ZIP_ENTRY",
    106     "RE_ZIP_COMMIT",
    107     "RE_ZIP4_ENTRY",
    108     "RE_ZIP4_COMMIT",
    109     "RE_PHONE_ENTRY",
    110     "RE_PHONE_COMMIT",
    111     "RE_SSN_ENTRY",
    112     "RE_SSN_COMMIT"
    113   ]);
    114 
    115 } catch (e) {
    116   app.alert("ERROR: " + e.toString());
    117 }
    118 endstream
    119 endobj
    120 {{xref}}
    121 trailer <<
    122   /Root 1 0 R
    123 >>
    124 {{startxref}}
    125 %%EOF
    126 
    127