blob: 531e679b05b53969b6fdcbc708bc109f0051af5c [file] [log] [blame]
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -07001{{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 1
11 /Kids [
12 3 0 R
13 ]
14>>
15endobj
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>>
32endobj
33% JS program to exexute
34{{object 11 0}} <<
Haibo Huang49cc9302020-04-27 16:14:24 -070035 {{streamlen}}
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070036>>
37stream
38function TestOneInput(x) {
39 try {
40 var s = util.byteToChar(x);
41 if (s.length) {
42 s = s.charCodeAt(0);
43 }
44 app.alert(x + " => " + s);
45 }
46 catch (e) {
47 app.alert(x + ": Caught error: " + e);
48 }
49}
50TestOneInput(0);
51TestOneInput(65);
52TestOneInput(127);
53TestOneInput(128);
54TestOneInput(255);
55TestOneInput(256);
56TestOneInput(40000000);
57TestOneInput(-1);
58try {
59 util.byteToChar();
60}
61catch (e) {
62 app.alert("Caught expected error: " + e);
63}
64try {
65 util.byteToChar({x:39});
66}
67catch (e) {
68 app.alert("Caught expected error: " + e);
69}
70endstream
71endobj
72{{xref}}
Haibo Huang49cc9302020-04-27 16:14:24 -070073{{trailer}}
Philip P. Moltmann4d3acf42017-03-20 11:05:52 -070074{{startxref}}
75%%EOF