xref: /aosp_15_r20/external/pdfium/testing/resources/javascript/app_properties.in (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1{{header}}
2{{object 1 0}} <<
3  /Type /Catalog
4  /Pages 2 0 R
5  /OpenAction 10 0 R
6>>
7endobj
8{{object 2 0}} <<
9  /Type /Pages
10  /Count 4
11  /Kids [
12    3 0 R
13    4 0 R
14    5 0 R
15    6 0 R
16  ]
17>>
18endobj
19% Page number 0.
20{{object 3 0}} <<
21  /Type /Page
22  /Parent 2 0 R
23  /Resources <<
24    /Font <</F1 15 0 R>>
25  >>
26  /MediaBox [0 0 612 792]
27>>
28endobj
29% Page number 1.
30{{object 4 0}} <<
31  /Type /Page
32  /Parent 2 0 R
33  /Resources <<
34    /Font <</F1 15 0 R>>
35  >>
36  /MediaBox [0 0 612 792]
37>>
38endobj
39% Page number 2.
40{{object 5 0}} <<
41  /Type /Page
42  /Parent 2 0 R
43  /Resources <<
44    /Font <</F1 15 0 R>>
45  >>
46  /MediaBox [0 0 612 792]
47>>
48endobj
49% Page number 3.
50{{object 6 0}} <<
51  /Type /Page
52  /Parent 2 0 R
53  /Resources <<
54    /Font <</F1 15 0 R>>
55  >>
56  /MediaBox [0 0 612 792]
57>>
58endobj
59
60% Info
61{{object 9 0}} <<
62  /Author (Joe Random Author)
63  /Creator (Joe Random Creator)
64>>
65endobj
66% OpenAction action
67{{object 10 0}} <<
68  /Type /Action
69  /S /JavaScript
70  /JS 11 0 R
71>>
72endobj
73% JS program to execute
74{{object 11 0}} <<
75  {{streamlen}}
76>>
77stream
78var app_props = [
79  'activeDocs',
80  'calculate',
81  'formsVersion',
82  'fs',
83  'fullscreen',
84  'language',
85  'media',
86  'platform',
87  'runtimeHighlight',
88  'viewerType',
89  'viewerVariation',
90  'viewerVersion'
91];
92
93function testGetProps(props) {
94  app.alert('*** Getting properties ***');
95  for (var i = 0; i < props.length; ++i) {
96    try {
97      var expr1 = "app." + props[i];
98      var expr2 = "typeof " + expr1;
99      app.alert(expr1 + " is " + eval(expr2) + ' ' + eval(expr1));
100    } catch (e) {
101      app.alert("ERROR: " + e.toString());
102    }
103  }
104}
105
106function testSetProps(props) {
107  app.alert('*** Setting properties ***');
108  for (var i = 0; i < props.length; ++i) {
109    try {
110      var expr1 = "app." + props[i] + ' = 3;'
111      app.alert(expr1 + " yields " + eval(expr1));
112    } catch (e) {
113      app.alert("ERROR: " + e.toString());
114    }
115  }
116}
117
118testGetProps(app_props);
119testSetProps(app_props);
120testGetProps(app_props);
121endstream
122endobj
123{{xref}}
124trailer <<
125  /Root 1 0 R
126  /Info 9 0 R
127>>
128{{startxref}}
129%%EOF
130