1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
|
\documentclass{article}
\usepackage[fleqn]{amsmath}
\usepackage[
web={centertitlepage,designv,
forcolorpaper,latextoc,pro},
eforms,linktoattachments,aebxmp
]{aeb_pro}
\usepackage{aeb_mlink}
\usepackage{graphicx,array}
%\usepackage{myriadpro}
%\usepackage[usecmtt]{myriadpro}
\usepackage[altbullet]{lucidbry}
\usepackage{makeidx}\makeindex
\usepackage{acroman}
\usepackage[active]{srcltx}
\urlstyle{sf}
\let\uif\textsf
\def\tutpath{doc/tutorial}
\def\tutpathi{tutorial}
\def\expath{../examples}
\def\verygoodbreak{%
\vskip0pt plus1in\goodbreak\vskip0pt plus-1in}
\DeclareDocInfo
{
university={\AcroTeX.Net},
title={\texorpdfstring{{\AcroEB} Professional\\[1em]}
{AcroTeX eDucation Bundle Professional: }%
Enhanced \texorpdfstring{\AEB}{AeB} Features using Acrobat Pro},
author={D. P. Story},
email={dpstory@acrotex.net},
subject={Documentation for {\AEBP} from AcroTeX},
talksite={\url{www.acrotex.net}},
version={v2.9b, 2018/02/17},
Keywords={XMP, E4X, Adobe Acrobat, JavaScript},
copyrightStatus=True,
copyrightNotice={Copyright (C) \the\year, D. P. Story},
copyrightInfoURL={http://www.acrotex.net},
authortitle={CEO and chief developer of AcroTeX.Net},
descriptionwriter={Good guy, but retired}
}
\def\dps{$\hbox{$\mathfrak D$\kern-.3em\hbox{$\mathfrak P$}%
\kern-.6em \hbox{$\mathcal S$}}$}
\universityLayout{fontsize=Large}
\titleLayout{fontsize=LARGE}
\authorLayout{fontsize=Large}
\tocLayout{fontsize=Large,color=aeb}
\sectionLayout{indent=-62.5pt,fontsize=large,color=aeb}
\subsectionLayout{indent=-31.25pt,color=aeb}
\subsubsectionLayout{indent=0pt,color=aeb}
\subsubDefaultDing{\texorpdfstring{$\bullet$}{\textrm\textbullet}}
%\pagestyle{empty}
%\parindent0pt \parskip\medskipamount
\makeatletter
\renewcommand{\paragraph}
{\@startsection{paragraph}{4}{0pt}{6pt}{-3pt}{\bfseries}}
\renewcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.5em}}
\renewcommand*\descriptionlabel[1]{\hspace\labelsep
\normalfont #1}
\newcommand{\aebDescriptionlabel}[1]{%
\setlength\dimen@{\amtIndent+\labelsep}%
{\hspace*{\dimen@}#1}}
\makeatother
\newenvironment{aebDescript}
{\begin{list}{}{\setlength{\labelwidth}{0pt}%
\setlength{\leftmargin}{\leftmargin}%
\setlength{\leftmargin}{\leftmargin+\amtIndent}%
\setlength\itemindent{-\leftmargin}%
\let\makelabel\aebDescriptionlabel
}}{\end{list}}
\def\AEBBook{\textsl{{Acro\!\TeX} eDucation System Tools: {\LaTeX} for interactive PDF documents}}
\def\AcroBlog{{Acro\!\TeX} Blog}
\newcommand\refctan[1]{\href{http://ctan.org/pkg/#1}{ctan.org/pkg/#1}}
\newlength{\aebdimen}
\def\anglemeta#1{$\langle\textit{\texttt{#1}}\rangle$}
\def\meta#1{\textit{\texttt{#1}}}
\let\pkg\textsf
\let\env\texttt
\let\opt\texttt
\let\app\textsf
\def\RMA{RMA}
\let\SC\relax
\def\SWF{SWF}
\def\FLV{FLV}
\let\EXT\relax
\def\AcroFLeX{AcroF\kern-.1667em
\lower.5ex\hbox{L}\kern-.3eme\kern-.125emX\@}
\def\AEB{\textsf{AeB}}
\def\AcroTeX{Acro\!\TeX}
\def\HTML{HTML}\def\FDF{FDF}
\def\PDF{PDF}\def\URL{URL}
\let\amtIndent\leftmargini
\def\bNH{\begin{NoHyper}}\def\eNH{\end{NoHyper}}
\def\nhnameref#1{\bNH\nameref{#1}\eNH}
\def\nhNameref#1{\bNH\Nameref{#1}\eNH}
\def\nhurl#1{\bNH\url{#1}\eNH}
\def\grayV#1{\textcolor{gray}{#1}}
\def\darg#1{\{#1\}}
\def\parboxValign{t}
\renewcommand*{\backrefalt}[4]{%
\ifcase #1\or
See page~#2.\else See pages~#2.\fi
}
\newenvironment{aebQuote}
{\list{}{\leftmargin\amtIndent}%
\item\relax}{\endlist}
\newcommand{\FmtMP}[2][0pt]{\mbox{}\marginpar{%
\raisebox{.5\baselineskip+#1}{%
\expandafter\parbox\expandafter[\parboxValign]%
{\marginparwidth}{\aebbkFmtMp#2}}}}
\def\aebbkFmtMp{\hfill\kern0pt\itshape\small
\color{blue}\raggedright\hspace{0pt}}
\newcommand{\BlogArticle}{\makebox[0pt][l]{\hspace{-1pt}\color{blue}\Pisymbol{webd}{254}%
}\raisebox{.5pt}{\color{red}\ding{045}}}
\def\dps{$\mbox{$\mathfrak D$\kern-.3em\mbox{$\mathfrak P$}%
\kern-.6em \hbox{$\mathcal S$}}$}
\def\FitItIn{\eq@fititin}
\def\endredpoint{\FitItIn{{\large\ifusebw\color{black}\else\color{red}\fi$\blacktriangleleft$}}}
\reversemarginpar
\def\addWatermarkFromFile#1#2{%
aebTrustedFunctions#1\theDocObject, aebAddWatermarkFromFile, #2}
%\definePath\bgPath{"C:/Users/Public/Documents/%
% ManualBGs/Manual_BG_Print_AeB.pdf"}
\chngDocObjectTo{\newDO}{doc}
\begin{docassembly}
var titleOfManual="The AeB Pro Manual";
var manualfilename="Manual_BG_Print_aebpro.pdf";
var manualtemplate="Manual_BG_Blue.pdf"; // Blue, Green, Brown
var _pathToBlank="C:/Users/Public/Documents/ManualBGs/"+manualtemplate;
var doc;
var buildIt=false;
if ( buildIt ) {
console.println("Creating new " + manualfilename + " file.");
doc = \appopenDoc({cPath: _pathToBlank, bHidden: true});
var _path=this.path;
var pos=_path.lastIndexOf("/");
_path=_path.substring(0,pos)+"/"+manualfilename;
\docSaveAs\newDO ({ cPath: _path });
doc.closeDoc();
doc = \appopenDoc({cPath: manualfilename, oDoc:this, bHidden: true});
f=doc.getField("ManualTitle");
f.value=titleOfManual;
doc.flattenPages();
\docSaveAs\newDO({ cPath: manualfilename });
doc.closeDoc();
} else {
console.println("Using the current "+manualfilename+" file.");
}
var _path=this.path;
var pos=_path.lastIndexOf("/");
_path=_path.substring(0,pos)+"/"+manualfilename;
\addWatermarkFromFile({
bOnTop:false,
bOnPrint:false,
cDIPath:_path
});
\executeSave();
\end{docassembly}
\begin{document}
\maketitle
\selectColors{linkColor=black}
\tableofcontents
\selectColors{linkColor=webgreen}
\section{Forward}
For the past several years (this year is 2016), I've been writing a book
titled,
\begin{quote}
\AEBBook.
\end{quote}
The book~\cite{book:AEBB} covers {\AEB}, which includes the \pkg{eforms}
package, and {\AEBP} in \emph{great detail} and includes many examples to
illustrate concepts and techniques. Numerous new examples are available on
the CD-ROM that accompanies the book.
During the time of the writing, each of the packages covered was examined,
bugs were fixed, and many new and major features were created. Any new
features developed in the course of writing the book are documented in the
book; however, they are \emph{not included in this documentation}. You can
either buy the yet-to-be-submitted book sometime in the future, or discover
the features by studying the DTX documentation of the program files. Sorry,
it took me three years to write the book, I don't want to spend another year
on this documentation. \verb!:-{)!
\begin{flushright}
Dr. D. P. Story\\[3pt]
January 20, 2016
\end{flushright}
\section{Overview}
\AEBP, package file base name \texttt{aeb\_pro}
(\href{http://ctan.org/pkg/aeb-pro}{ctan.org/pkg/aeb-pro}), is an assortment
of features (see Section~\ref*{features} below) implemented through a
combination of \textbf{pdfmark} operators~\cite{tech:pdfmark}, which are
native to a PostScript file, and JavaScript techniques, some of which require
\textsf{Acrobat Professional}. These features were meant to be used with
{\AEB} (\AcroEB); in particular, the \texttt{insdljs} and \texttt{eforms}
packages are essential to {\AEBP}. To have access to all the features of
{\AEBP}, the document author must have \textsf{Acrobat Pro}~7.0 or later and
use \textsf{dvips/\penalty0 Distiller} workflow to create the {\PDF}. For the
most part, once the document is assembled, it can be viewed by \app{Adobe
Reader}~7.0 or later.
Despite the declaration in the \textbf{Forward} to the
contrary\marginpar{\small\raggedleft v2.1 notes}, this manual will be updated
for Version~2.1 of {\AEBP} to reflect the creation of a significant new
feature, the \opt{useacrobat} option. For a document author who prefers
\app{pdflatex} (including \app{lualatex}) or
\app{xelatex}\marginpar{\small\raggedleft non-\app{Distiller} workflow}, this
option opens the features of {\AEBP} provided the document author has the
full \app{Acrobat} application and has set it up as the primary {\PDF} viewer
on his/\penalty0 her computer system. Continue reading about the
\app{useacrobat} option on page~\pageref{item:useacrobat}. The \opt{nopro}
option has changed as well, the code base that does not depend on the
\app{Acrobat} application is now available to non-\app{Distiller} workflows;
refer to the description of the \opt{nopro} option on
page~\pageref{item:nopro} for additional details.
\subsection{Dedication}
This is a package that I've been meaning to write for some time, it has
had to wait for my retirement. The {\AEBP} package includes several
techniques that I've developed over the years for my personal use, and a
few new ones. The techniques require \textsf{Acrobat Pro}~7.0 or later,
as well as the \textsf{Adobe Distiller}.
As a now former educator, I've always preferred the use of
\textsf{Acrobat}/\textsf{Distiller} over \textsf{pdftex}/\textsf{Adobe
Reader}. I recognize the debt I owe to the {\Y&Y} {\TeX}
System,\footnote{Sadly, now out of business. {\Y&Y} was a critically
important partner in my efforts: its early use of type~1 fonts made it
easy to use different fonts; its excellent dviwindo previewer---still
unsurpassed by current previewers---was an essential tool in much of what
I did, and really fired my imagination.} and to \textsf{Acrobat} and
\textsf{Distiller}.\footnote{Though \textsf{pdftex} and \textsf{dvipdfm}
are important applications and have their place in the {\LaTeX} to PDF
workflow, I found them too limiting and too slow in development. For
Acrobat, you have a team of top professional software developers working
on the Acrobat/Adobe Reader applications, as opposed to academics working
sporadically on a PDF creator. The viability of the applications
(\textsf{pdftex} and \textsf{dvipdfm}) ultimately depend on too few
individuals.} These systems have inspired me and have made it easy to
develop new ideas. I believe that if I had not used the Windows/Acrobat
platform, I would not have developed all the packages and systems that I
did.\footnote{An Internet colleague once asked me why I didn't switch over
to Linux, I responded that if I had done that, we would not know each
other. We were brought together by the software development that I did on
the Windows/Acrobat platform. Switching would have shut me down from the
beginning.}
I dedicate \textsf{{\AEBP}} to {\Y&Y} (developer Berthold K. P. Horn) and
to Adobe Systems, developer of \textsf{Acrobat}. Since I entered the
Internet education business, I've gotten to know Berthold quite well
through our email correspondence, and many of the software engineers of
the \textsf{Acrobat} software engineering team.\footnote{In the year 2000,
I took a seven month sabbatical in San Jos\'e, CA, and worked on the
\textsf{Acrobat} software engineering team, for \textsf{Acrobat}~5.0. Good
memories from my days with Adobe remain. I made good friends there.} Thank
you all for your wonderful work.
\subsection{Features}\label{features}
As you might discern from the table of contents, this package features:
\begin{enumerate}
\item {\AEB} Central Control: A uniform way of handling the packages in
the Acro\!{\TeX} Family of Software.
\item Supports all fields in the Initial View tab of the Document Properties
dialog box.
\item Complete support for document level JavaScripts and for document actions.
\item Complete support for page actions, both open and close events.
\item Complete support for fullscreen mode.
\item Support for attaching documents, and for linking to and for launching embedded files.
\item Support for creating a PDF Package, new to version 8 of
\textsf{Acrobat}.
\item Support for what I call document assembly methods, which I've found to be very useful
through the years. (This technique was developed in the year 2000 while I was out in
San Jos\'{e}.)
\item Support for the use of Optional Content Groups, rollovers and animations.
\end{enumerate}
I anticipate future developments.
\subsection{Sample Files and Articles}\label{s:samplefiles}
The basic distribution demonstration files are available from the
\href{http://www.math.uakron.edu/~dpstory/aeb_pro.html}{\AEBP}
website.\footnote{\url{\bUrl/aeb_pro.html}}
\paragraph*{\AcroBlog.}\label{para:AcroBlog} The basic examples from the distribution are also available
from the \AcroBlog, accessible from the page
\href{http://www.acrotex.net/blog/?cat=98}{{\AEBP} Demo Files}.\footnote{\url{http://www.acrotex.net/blog/?cat=98}}
There is another more recent collection of examples on
\href{\urlAcroTeXBlog}{\AcroTeX{} Blog}, these will be referenced in the margin using the icon %\exAeBBlogPDF
\mbox{\makebox[0pt][l]{\textcolor{blue}{\Pisymbol{webd}{254}}}%
\raisebox{-2pt}{\color{red}{{\zqacr b\hspace{9.5pt}}}}}\,, whereas
\mbox{\makebox[0pt][l]{\hspace{-1pt}\textcolor{blue}{\Pisymbol{webd}{254}}}%
\raisebox{.5pt}{\color{red}{\ding{045}}}} refers to a written blog
article. In all cases, the source file and any dependent resources are attached to the
PDF. A listing of all examples that have the \textit{\href{\urlAcroTeXBlog/?tag=aeb-pro}{aeb-pro}}
tag.\footnote{\url{\urlAcroTeXBlog/?tag=aeb-pro}}
%\exAeBBlogPDF{p=877} See the file \texttt{\href{\urlAcroTeXBlog/?p=877}{bgtest.pdf}}.
\subsection{Requirements}
To open this package up to a wider population of users, the requirements for
this package have changed; the document author is no longer required to own
the \app{Acrobat} application (strongly recommended) and is no longer
required to use the \app{dvips/Distiller} workflow, as previous versions have
required. This package classifies you, as the document author, into one of
three groups:
\begin{enumerate}
\item You own \app{Acrobat} and use the \app{dvips/\penalty0 Distiller}
workflow. This is the ideal workflow for this package because all
features of this package are available.
\item You own \app{Acrobat} but prefer to use a non-\app{Distiller}
workflow; that is, you prefer to use the applications
\app{pdflatex}, \app{lualatex}, or \app{xelatex}. In this case,
almost all features are available through the \opt{useacrobat}
option, refer to the initial description of this option on
page~\pageref{item:useacrobat}.
\item You do not own \app{Acrobat}, your {\PDF} creator must be
\app{pdflatex}, \app{lualatex}, or \app{xelatex}. To avoid compile
errors, you must use the \opt{nopro} option, read the initial description
of this option on page~\pageref{item:nopro}.
\end{enumerate}
If you do own \app{Acrobat}, it must be version~7 or later; to repeat,
$$
\boxed{\text{\textbf{\textsf{Acrobat~7.0 Professional}} or later is required}}
$$
If you do not own \app{Acrobat} and you want to access the extensive features
of {\AEBP} beyond what the \opt{nopro} option provides, you need to buy the
application.\footnote{In the United States and Europe, Adobe offers a
significant academic discount on its software, including \app{Acrobat
Pro}. Educators should look into the price structure of \app{Adobe Acrobat}
at their institutions; perhaps, their Department or College can supply a
financial grant for the purchase of the software.} Once the document is
built, however, \textsf{\textbf{Adobe Reader~7.0}} (or later) is sufficient
to view the document. This is a reasonable restriction since some JavaScript
techniques used by this package require \app{Acrobat Pro}.
\textbf{{\AEBP}} requires the \pkg{insdljs} and
\pkg{eforms} packages, both of which are included with the
\textbf{\AcroEB} (\AEB) distribution. The use of the {\Web} package
is optional, though highly recommended. These are all meant to fit
together as a comprehensive and unified family of packages, after all.
\newtopic Below is a list of other required packages used by the \AEBP:
\begin{enumerate}
\item \textsf{hyperref}: The \textsf{hyperref} bundle should be
already on your system, it is standard to most {\LaTeX} distributions.
\item \texttt{xkeyval}: The very excellent package by Hendri
Adriaens. This package allows developers to write commands
that take a variety of complex optional arguments. You should
get the most recent version, at this writing, the latest is
v2.5e, or later.
\item \texttt{xcolor}: An amazing color package by Dr. Uwe Kern.
This package makes it easy to write commands to dim the color.
Get a recent version, at this writing, the latest is v2.08
(2005/11/25).
\item \texttt{truncate}: This package, by Donald Arseneau, is used in the navigation panel to abbreviate the
section titles if they are too wide for the panel. This package is distributed with
the \APB.
\item \texttt{comment}: A general purpose package, Victor Eijkhout, for creating environments that can be
included in the document or excluded as comments. A very useful package for {\LaTeX}
package developers. This package is distributed with the \APB.
\item \texttt{eso-pic} by Rolf Niepraschk and \texttt{everyshi} by Martin Schr\"oder, these are used
by {\Web} to create background graphics and graphic overlays.
\end{enumerate}
One of the extremely nice features of \textbf{MiK\TeX} is
that it can automatically download and install any unknown packages
onto your hard drive, so getting the {\AEBP} up and running is not a
problem!
\subsection{The {\AEBP} Family of Software}
To qualify to be a member of the `{\AEBP} Pro' family, a package must require \app{Acrobat Distiller}
as the PDF creator. We list many of the members of this exclusive family.
\begin{description}\def\NH{\hspace*{-\labelsep}}
\item\NH\pkg{aebxmp} is a {\LaTeX} package (\refctan{aebxmp}) that
fills in the advance metadata. The package requires \app{Acrobat}~8
Professional and uses \SC{E4X}, the \SC{XML} parser that is built
into the JavaScript engine.
\item\NH\pkg{rmannot} (\refctan{rmannot}) creates rich media
annotations (\RMA), which may embed or stream {\SWF}, {\FLV}, and
\EXT{MP3} files for playing while a document is being read.
Rich media annotation is a feature of \app{Acrobat}/\app{Adobe
Reader}, version~9 or later. \app{Acrobat Pro} and \app{Acrobat
Distiller} (version~9 or later) are required to build a document, and
\app{Adobe Reader} (version~9 or later) is needed to activate the
annotation and play the media.
\item\NH \app{\AcroFLeX} is an application of the \pkg{rmannot} package
briefly described above. The \pkg{acroflex} package
(\refctan{acroflex}) creates a graphing screen. The user can type in
functions and graph them. A graphing screen can be populated with
pre-packaged functions for the user to scrutinize and interact with.
The package can graph functions of a single variable $x$, a pair of
parametric equations that are functions of $t$, and a polar function of
$t$.
The graphing screen is a rich media annotation that uses a specially
developed {\SWF} file, called the {\AcroFLeX} Graphing widget. The package
takes advantage of rich media annotations, a version~9 feature of
\app{Acrobat}; it therefore requires \app{Acrobat Pro and Distiller}
version 9 or later. The user needs to use \app{Adobe Reader} (version~9.0
or later) in order to obtain the graphing functionality.
\item\NH \pkg{aeb\_mlink} (\refctan{aeb-mlink})
creates hypertext links in documents for text extending over
\emph{multiple lines}. The package requires that the {\PDF} be
created by \app{Acrobat Distiller}, version~7.0 or later to create
multi-line links, and requires \app{Adobe Reader}~7.0 or later for
the links to work correctly.
\item\NH\pkg{annot\_pro} (\refctan{annot-pro}) is used to
create text, stamp, and file attachment annotations using
\app{Acrobat Distiller} that can then be viewed in \app{Adobe
Reader}.
\item\NH \pkg{graphicxsp} (\refctan{graphicxsp}) embeds a graphic file in
a {\PDF} document in such a way that the author may reuse that same
graphics without significantly increasing the file size. The
package also supports the Adobe transparency model.
\end{description}
The next three packages are less important, some are ``novelty'' packages.
\begin{description}\def\NH{\hspace*{-\labelsep}}
\item \NH\pkg{acrosort} (\refctan{acrosort}) is a novelty package for
importing an image that has been sliced into rows and columns and
randomly rearranged. The JavaScript does a bubble sort on the
picture.
\item \NH \pkg{{\AEB} Slicing} is a batch sequence
(\refctan{aebslicing}) for \app{Acrobat Pro} that takes the image
open in \app{Acrobat} and slices it into a specified number of rows
and columns, and saves the slices to a designated folder. It is
used for the \pkg{acromemory} package.
\item \NH \pkg{acromemory} is a {\LaTeX} package (\refctan{acromemory})
that implements two variations of a memory game: (1) a single game
board consisting of a number of tiles, each tile has a matching
twin, the object is to find all the matching twins; (2) two game
boards, both identical except one has been randomly rearranged, the
object is the find the matching pieces in each of the two game
boards. The \pkg{{\AEB} Slicing} is used to slice the image into a specified
number of rows and columns.
\end{description}
These, as well as the {\AEBP} distribution itself, are available through CTAN
or the {\AEBP} family website:
\begin{equation*}
\text{\url{www.math.uakron.edu/~dpstory/aeb_pro.html}}
\end{equation*}
\subsection{Package Options}
Below is a list of all options of the {\cAEBP} package:
\begin{description}
\item [\texttt{driver=\anglemeta{driver}}\enspace] The permissible values
of \anglemeta{driver} are \opt{dvips}, \opt{dvipsone}, \opt{pdftex},
and \opt{xetex}. The latter two are automatically detected and need
not be specified. If no detectable driver is identified and no driver
is given, \opt{dvips} is assumed.
\item [\texttt{useacrobat}\enspace]\label{item:useacrobat} For those who prefer to use
\app{pdflatex} (or \app{lualatex}) or \app{xelatex} \emph{and} who
own the \app{Acrobat} application, use the \opt{useacrobat} option to
open all features of this package except for any features associated
with the \app{uselayers} option. The creation of layers is still only
supported through the \textbf{pdfmark} operator.
As you go through the examples provided by this package, all sample
files work except for the ones using the \opt{uselayers} or
\opt{ocganime} option.
Continue reading about the \opt{useacrobat} option in Section~\ref{useacrobatOpt}.
\item [\texttt{nopro}\enspace]\label{item:nopro} If this option is taken,
then no code that requires \app{Distiller} or \app{Acrobat} is input.
Authors who use \app{pdflatex/\penalty0 lualatex/\penalty0 xelatex}
and who do not own the \app{Acrobat} application may have access to
the `nopro' features by taking the \opt{nopro} option.
Continue reading about the \opt{nopro} option in
Section~\ref{s:noproOpt}.
\item [{\AEBP} Options\enspace] The {\cAEBP} package recognizes the
components of {\AEB}, these are \texttt{web}, \texttt{exerquiz},
\texttt{dljslib}, \texttt{eforms}, \texttt{insdljs},
\texttt{eq2db}, \texttt{aebxmp},
\texttt{graphicxsp}, \texttt{hyper\-ref}. The value of each of these is a list of
options you want that package to use. (The hyperref package is not
a component of {\AEB}, but it is such an integral part of {\AEB} that it
is included.) See \hyperref[AeBCC]{Section~\ref*{AeBCC}},
page~\pageref*{AeBCC}.
\item [\texttt{gopro}\enspace] Some components of {\AEB} have a pro option,
when you use the gopro option of {\cAEBP}, the \texttt{pro} option
is passed to all components of {\cAEBP} that have a \texttt{pro}
option.
\item [\texttt{attachsource}\enspace] This key has as its value a list of
extensions. For each extension listed, the file \cs{jobname.ext}
will be attached to the parent PDF. See
\hyperref[attachsource]{Section~\ref*{attachsource}},
page~\pageref*{attachsource}.
\item [\texttt{attachments}\enspace] This key has its value a list of paths
to files to be attached to the parent document. See
\hyperref[attachments]{Section~\ref*{attachments}},
page~\pageref*{attachments}.
\item [\texttt{linktoattachments}\enspace] Invoking this option causes code
for linking to attachments, or for giving attachments descriptions
other than the default ones. See
\hyperref[linktoattachments]{Section~\ref*{linktoattachments}},
page~\pageref*{linktoattachments}.
%\item [\texttt{latin1}\enspace] A companion option to \texttt{linktoattachments}. When this
% option is used, the set of latin1 unicodes are input and are
% available to be used in the descriptions of attachments.
% See `\nameref{description}' on page~\pageref*{description}.
\item [\texttt{childof}\enspace] In a {\LaTeX} child document, use this
option to set the path back to the parent document. See
\hyperref[childof]{Section~\ref*{childof}},
page~\pageref*{childof}.
\item [\texttt{btnanime}\enspace] When this option is taken, the code for button
animation is included in the compilation. See
\hyperref[s:btnanime]{Section~\ref*{s:btnanime}},
page~\pageref*{s:btnanime} for details.
\item [\texttt{uselayers}\enspace] Taking this option brings in code in
support of Optional Content Groups, see
\hyperref[layers]{Section~\ref*{layers}}, page~\pageref*{layers}.
\item [\texttt{ocganime}\enspace] When this option is taken, the code for
ocg animation is included in the compilation. See
\hyperref[ss:ocganime]{Section~\ref*{ss:ocganime}},
page~\pageref*{ss:ocganime} for details.
\end{description}
%\verygoodbreak
\subsection{Installation}
%The {\AEB} distribution comes in two ZIP files: \texttt{acrotex\_pack} and
%and \texttt{acrotex\_exdoc}. The former contains the program files and
%documentation, and the latter contains example files and other documentation.
%Instructions for installing and unpacking the distribution follow.
{\AEBP} requires the installation of {\AEB}
(\href{http://ctan.org/pkg/acrotex}{ctan.org/pkg/acrotex}). Be sure to
install {\AEB} and to read the installation instructions. In this section, we
outline the method of installing {\AEBP}.
\subsubsection{Automatic installation}
Some {\TeX} systems, most notably \textbf{MiK\TeX} and \textbf{{\TeX} Live},
have a Package Manager to automatically download and install {\LaTeX}
packages. If you have a Package Manager and not installed {\AEBP} do so now.
After {\AEBP} is installed, it is not quite ready to be used. Locate where
the Package Manager installed the documentation portion of the installation,
for MiK\TeX, this might be at
\begin{Verbatim}[xleftmargin=\amtIndent]
C:\Program Files (x86)\MiKTeX 2.9\doc\latex\aeb-pro
\end{Verbatim}
(This path assumes the use of \textbf{MiK\TeX~2.9}.) The folder contains documentation and example files. If also contains the two
JavaScript files, \texttt{aeb.js} and \texttt{aeb\_pro.js}. Refer to
\nhNameref{ss:aebpjs} for more information on the installation of these two files.
\subsubsection{Manual installation}
Manual installation may be necessary for some {\TeX} systems, or for the case
where you have downloaded the ZIP package files from CTAN or from the home website of
{\AEBP} at \url{\bUrl/aeb_pro.html}.
The {\AEBP} distribution comes in two ZIP files: \texttt{aebpro\_pack.zip}
and \texttt{aebpro.zip}. The first contains the program files and
documentation,\footnote{Available from \url{\bUrl/aeb_pro.html}} the latter
contains the full distribution, including program files, documentation, and
example files. If you already have {\AEBP}, it suffices to update your
installation using \texttt{aebpro\_pack.zip}. If you don't have {\AEBP}
already installed, the install the contents of \texttt{aebpro.zip}.
\newtopic To install {\AEBP}, use the following steps:
\begin{enumerate}
\item Place \texttt{aebpro.zip} (or possibly \texttt{aebpro\_pack.zip}) on your latex search file
and unzip. (If you already have an \texttt{aeb\_pro} folder, unzip
one level above the \texttt{aeb\_pro} folder.) Unzipping creates
a folder named \texttt{aeb\_pro}.
\item[] \textbf{Installing {\AEBP} with MiK\TeX{} 2.8 or later.}
{MiK\TeX}~2.8 or later is more particular about where you install
packages by hand. If you are installing {\AEBP} by hand, {MiK\TeX}~2.8/2.9
requires that you install the distribution in a local root TDS tree.
Review the {MiK\TeX} help page on this topic
\begin{equation*}
\text{\url{http://docs.miktex.org/manual/localadditions.html}}
\end{equation*}
Within \verb!C:\Local TeX Files\tex\latex!, copy
\texttt{aebpro\_pack.zip} (and possibly \texttt{aebpro.zip}) and unzip. Unzipping creates a folder
named \texttt{aeb\_pro}.
\item[] If you already have {\AEBP} that was automatically installed on your {MiK\TeX}
system, you should delete this old version of {\AEBP}. You may have to use the
{MiK\TeX} package manager to remove them from the {MiK\TeX} database registry.
\item Within the \texttt{aeb\_pro} folder, latex the file \texttt{aeb\_pro.ins} file, this unpacks
the installation.
\item[] Users of \textbf{MiK\!\TeX} need to refresh the filename database.
\item Install the JavaScript file, \texttt{aeb\_pro.js}, as explained in the next subsection.
\end{enumerate}
\noindent{\AEB} (\AcroEB) is also required, installation instructions are contained
in the {\AEB} reference document, the instructions are reproduced here for your convenience.
\newtopic To install {\AEB}, use the following steps:
\begin{enumerate}
\item Place \texttt{acrotex.zip} in your latex search file and unzip. (If
you already have an \texttt{acrotex} folder, you should unzip the file
\texttt{acrotex.zip} one level above the \texttt{acrotex} folder.)
Unzipping creates a folder named \texttt{acrotex}.
\item[] \textbf{Installing {\AEB} with {MiK\TeX} 2.8 or later.} {MiK\TeX} is more particular
about where you install packages by hand. If you are installing
{\AEB} by hand (recommended), {MiK\TeX} requires that you install the distribution
in a local root TDS tree. Review the {MiK\TeX} help page on this topic
\begin{equation*}
\text{\url{http://docs.miktex.org/manual/localadditions.html}}
\end{equation*}
Within the local root folder, e.g.,
\texttt{C:\string\Local\ TeX Files\string\tex\string\latex}, copy the file \texttt{acrotex.zip} and unzip it.
Unzipping creates a folder named \texttt{acrotex}.
\item[] If you already have {\AEB} that was automatically installed on your {MiK\TeX}
system, you should delete this old version of {\AEB}. You may have to use the
{MiK\TeX} Package M anager to remove them from the {MiK\TeX} database registry.
\item Within the \texttt{acrotex} folder, latex the file
\texttt{acrotex.ins} file, this unpacks the installation.
\item[] Users of \textbf{MiK\!\TeX} need to refresh the filename database.
\item Install the JavaScript file, \texttt{aeb.js}, as explained in the next subsection.
\end{enumerate}
\subsubsection{Installing \texttt{aeb\_pro.js} and \texttt{aeb.js}}\label{ss:aebpjs}
The instructions for installing the JavaScript support files
\texttt{aeb\_pro.js} and \texttt{aeb.js} are in the
\texttt{\href{install_jsfiles.pdf}{install\_jsfiles.pdf}}, which resides in
the \texttt{doc} folder of the \texttt{aeb\_pro} installation.
After you've installed the JavaScript files, as directed by the
\texttt{\href{install_jsfiles.pdf}{install\_jsfiles.pdf}}, validate the
installation of the JavaScript files by navigating to the \texttt{examples}
subfolder and opening the file \texttt{test\_install.pdf} in \app{Acrobat};
follow the directions contained on that one page document.
\begin{comment}
The JavaScript methods used by the \texttt{docassemble} environment, see
\mlNameref{docassembly}, have a security setting in \textsf{Acrobat};
\textsf{Acrobat} requires that such methods be \emph{trusted methods}. The
file \texttt{aeb\_pro.js} enables you to execute the doc assembly methods
described later without \textsf{Acrobat} raising security exception.
The JavaScript file \texttt{aeb.js}, which comes with {\AEB}, is only ~needed
if you use \textsf{Acrobat Pro}~8.1 or later. Increased security in that
version has made it necessary to install a folder JavaScript file to be
able to install document level JavaScripts.
\paragraph*{Acrobat Pro~8.1 or later.} Start \textsf{Acrobat Pro}~8.1 or
later, and open the console window \textsf{Advanced \texttt> JavaScript
\texttt> Debugger} (\texttt{Ctrl+J}). Copy and paste the following code
into the window.
\begin{Verbatim}
app.getPath("user","javascript");
\end{Verbatim}
Now, this the mouse cursor on the line containing this script, press
the \texttt{Ctrl+Enter} key. This will execute this JavaScript. This
JavaScript method returns the path to where \texttt{aeb.js} and
\texttt{aeb\_pro.js} should be placed. For example, on my system,
the return string is
\begin{Verbatim}[fontsize=\small]
/C/Documents and Settings/story/
Application Data/Adobe/Acrobat/8.0/JavaScripts
\end{Verbatim}
Follow the path to this folder. If the \texttt{JavaScripts} folder does
not exist, create it. Finally, copy both \texttt{aeb.js} and
\texttt{aeb\_pro.js} into this folder. Close \textsf{Acrobat}, the next
time \textsf{Acrobat} is started, it will read in the to \texttt{.js}
files.
\paragraph*{Acrobat Pro~10.1.1.} For this version of \textsf{Acrobat},
things have tightened up even more. The user JavaScripts folder has moved to
\begin{Verbatim}[fontsize=\small]
%AppData%\Adobe\Acrobat\Privileged\10.0\JavaScripts
\end{Verbatim}
where \verb!%AppData%! is an environment variable defined by Acrobat. For details
of how to install the folder JavaScripts in the new location, see my blog
article \mlhref{http://www.acrotex.net/blog/?p=737}{Acrobat Security Changes in 10.1.1 and
Acro\!\TeX}.
\end{comment}
\subsubsection{Installing \texttt{aebpro.cfg}}
The distribution comes with a file named \texttt{aebpro.cfg}, the
contents of which are displayed below:
\begin{Verbatim}
%
% AeB Pro Configuration file
%
\ExecuteOptionsX{driver=dvips}
\end{Verbatim}
Locate this file in the root folder of the {\AEBP} installation. If the
driver is specified in the configuration file, it need not be included in the
option list of \texttt{aeb\_pro}.
\subsection{Examples}
The following is a list of the example files that illustrate and
test various features of {\AEBP}.
\begin{enumerate}
\item \texttt{\href{\urlAcroTeXBlog/?p=1237}{aebpro\_ex1.tex}}: Illustrates the document and page
open/close actions and full screen support of {\AEBP}.
\item \texttt{\href{\urlAcroTeXBlog/?p=1242}{aebpro\_ex2.tex}}: Demonstrates the features of the
\texttt{pro} option of the \textsf{web} package, including enhanced control
over the layout of section headings and the title page.
\item \texttt{\href{\urlAcroTeXBlog/?p=1245}{aebpro\_ex3.tex}}: Highlights the various attachment options and the
doc assembly methods.
\item \texttt{\href{\urlAcroTeXBlog/?p=1251}{aebpro\_ex4.tex}}: A discussion of layers, rollovers
and animation.
\item \texttt{\href{\urlAcroTeXBlog/?p=1257}{aebpro\_ex5.tex}}: This file discusses linking to attachments
and covers commands \cs{ahyperref}, \cs{ahyperlink} and
\cs{ahyperextract}.
\item \texttt{\href{\urlAcroTeXBlog/?p=1263}{aebpro\_ex6.tex}}: Learn how
to create a PDF Package out of your attachments.
\item \texttt{\href{\urlAcroTeXBlog/?p=1266}{aebpro\_ex7.tex}}:
Explore the \cs{DeclareInitView} command, documentation included in
this file.
\item \texttt{\href{\urlAcroTeXBlog/?p=1268}{aebpro\_ex8.tex}}: Details
of how to use unicode to set the initial value(s) of field, or as
captions on a button.
\end{enumerate}
These sample files are available in the \texttt{examples} folder of the
\texttt{aeb\_pro} folder. When links given above are to the same files on the
{\AcroBlog}.
\exPDFSrc{aebpro_ex1} Throughout this document, the above exercises are
referenced using icons in the left margins. These icons are live hyperlinks
to the source file or the PDF. For example, we reference \texttt{aebpro\_ex1}
in this paragraph. The example files can be found in the \texttt{examples}
sub-folder of the \texttt{aeb\_pro} distribution. Alternatively, if the above
links do not work because you have moved this documentation, you can also
access the basic distribution examples from the {\AcroBlog} website, refer to
the named paragraph \textbf{\nhnameref{para:AcroBlog}}\FmtMP{\BlogArticle} on page~\pageref{para:AcroBlog}
for links to this resource.
\section{Concerning the
\texorpdfstring{\protect\opt{useacrobat}}{useacrobat}
option}\label{useacrobatOpt}
For document authors who have the full \app{Acrobat} application but prefer a
non-\app{Distiller} workflow, use the \opt{useacrobat} option to declare to {\AEBP}
that you have \app{Acrobat}. Traditionally, if neither \app{pdflatex}
(including \app{lualatex}) nor \app{xelatex} are used, a \app{dvips/\penalty0
Distiller} workflow is assumed. Declaring the \opt{useacrobat} option opens
up all features except for those that depend on the use of layers (also
called {\EXT{OCG}s); in particular, the options \opt{uselayers} and
\opt{ocganime} are disallowed}. All features, therefore, described in this
manual are available to \app{pdflatex} and \app{xelatex} document authors who
have \app{Acrobat}, \emph{except for those features} described in
Section~\ref{layers} and Section~\ref{ss:ocganime}.
\paragraph*{Syntax.} The syntax for this option is simple:
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\usepackage[!textbf(useacrobat),
!meta(options)
]{aeb_pro}
\end{Verbatim}
where \meta{options} \emph{does not include} the
\opt{uselayers} and \opt{ocganime} options.
\newtopic
Regarding \app{{\AEB} Control Central} (Section~\ref*{AeBCC}), when you
specify \opt{useacrobat},\footnote{This implies you are not using
\opt{Distiller} as the {\PDF} creator.} the packages \pkg{graphicxsp} and \pkg{rmannot} of
display~\eqref{display:ACCopts} are not allowed to be specified in the option
list of \pkg{aeb\_pro}. These two packages use the \textbf{pdfmark} operator
to implement their features; a \app{dvips/\penalty0 Distiller} workflow is
required in this case.
\section{The \texorpdfstring{\protect\opt{nopro}}{nopro} option}\label{s:noproOpt}
For authors \emph{who do not have} the \app{Acrobat} application, you must
use \app{pdflatex} (or \app{lualatex}) or \app{xelatex} to produce your
{\PDF}. The only option for using {\AEBP} is to specify the \opt{nopro}
option.
\paragraph*{Syntax.} The syntax for \opt{nopro} is to declare it
in the option list:
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\usepackage[!textbf(nopro),
!meta(options)
]{aeb_pro}
\end{Verbatim}
Specifying this option excludes the use of layers (the options
\opt{uselayers} and \opt{ocganime} are prohibited) and any commands or
environments that use `post-{\PDF} creation' methods\index{post-PDF creation
methods!referenced} will silently (or not so silently) fail. All features are
available that are implemented using {\LaTeX} that does not depend on the
driver, or {\LaTeX} that is driver dependent. These include the commands and
environments of Sections~\ref{AeBCC}--\ref{FSSupport}.
\section{\texorpdfstring{\AEB}{AeB} Control Central}\label{AeBCC}
The {\AEB} family of software, {\LaTeX} packages all, are for the most
part stand alone; however, usually they are used in combination with
each other, at least that is the purpose for which they were
originally designed. When several members of family {\AEB} are used,
they should be loaded in the optimal order. With {\cAEBP}, you can
now list the members of the {\AEB} family you wish to use, along with
their optional parameters you wish to use.
The {\AEB} components supported by {\AEBP} are listed below.
\begin{equation}
\begin{tabular}{lllll}
\pkg{web}&\pkg{exerquiz}&\pkg{dljslib}&\pkg{eforms}&\pkg{insdljs}\\\relax
\pkg{eq2db}&\pkg{aebxmp}&\pkg{hyperref}&\pkg{graphicxsp}&\pkg{rmannot}
\end{tabular}\label{display:ACCopts}
\end{equation}
The phrase `\app{{\AEB} Control Central}' refers to using these package names
as options for the \pkg{aeb\_pro} package. Simply listing a component will
cause {\cAEBP} to install that component with its default optional
parameters; by specifying a value---a list of options required---will cause
{\cAEBP} to load the package with the listed options.
\Ex{} Below is a representative example of the use of the {\AEB}
options of {\AEBP}, {\AEB} Control Central!
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily web=\darg{pro,designv,tight,usesf,req=2016/11/03},}%
\begin{dCmd*}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\usepackage[%
driver=dvips,
web={pro,designv,tight,usesf,req=2016/11/03},
exerquiz={!anglemeta(pkg-opts)},
...,
aebxmp
]{aeb_pro}[2016/12/10]
\end{dCmd*}
\egroup\noindent Yes, yes, I know this is not necessary, you can always load the
packages earlier than {\cAEBP}, but please, humor me.
Beginning with \pkg{aeb\_pro} dated 2016/12/10, a new \texttt{req} key is
defined for the values of the {\AEB} packages listed in
display~\eqref{display:ACCopts}. Using the \texttt{req} you can specify the
release date (required date) of the {\AEB} package being used; this assures
that the document will compile and any new JavaScript code is present. In the
example above, the \pkg{web} package is required for release date of
2016/11/03 (or later); the \pkg{aeb\_pro} release date of 2016/12/10 is
required, for that is the date this \texttt{req} key was implemented. The
\texttt{req} key is optional.
By default, the code for supporting features that require the use of
\textsf{Distiller} and \textsf{Acrobat~Pro} are included; there is a
\texttt{nopro} option that excludes these features. Use the \texttt{nopro}
if you only wish to use the {\AEB} Control Center feature to load the various
members of the {\AcroTeX} family. If \texttt{nopro} is used, {\AEBP} can
be used with \textsf{pdftex} and \textsf{xetex}, for example. Of course, if you
own the \app{Acrobat} application, a subset of features are available, as discussed
Section~\ref{useacrobatOpt}, using the \opt{useacrobat} option.
See the new {\AEB} manual for documentation on the \texttt{pro} option of
\Web. The support document \texttt{aebpro\_ex2} also presents a tutorial
on the \texttt{pro} option.
\exPDFSrc{aebpro_ex2} The support file \texttt{aebpro\_ex2} has a
section discussing the {\AEB} Control Central, as well as features of
the \opt{extended} (\opt{pro}) option of the {\Web} package.
\section{Declaring the Initial View}
The \Com{DeclareInitView} command is a ``data structure'' for setting the
\uif{Initial View} of the \uif{Document Propertie}s dialog box, see
\hyperref[docprops]{Figure~\ref*{docprops}}. \cs{DeclareInitView} takes up to
three key-value pairs, the three keys correspond to the three named regions
of the UI (User Interface):
\begin{center}\setlength{\extrarowheight}{2pt}
\begin{tabular}{|ll|}\hline
Key & User Interface Name\\\hline
\texttt{layoutmag} & Layout and Magnification\\
\texttt{windowoptions} & Window Options\\
\texttt{uioptions} & User Interface Options\\\hline
\end{tabular}
\end{center}
The values of each these three are described in the tables below:
\begin{itemize}
\item \texttt{layoutmag}: This key sets the initial page layout and magnification
of the document. The values of this key are themselves key-values:
\begin{small}\setlength{\extrarowheight}{3pt}
\begin{tabular}{|>{\ttfamily}l>{\ttfamily\raggedright}p{1.85in}>{\raggedright}p{2.06in}|}\hline
\multicolumn{1}{|l}{Key} &\multicolumn{1}{l}{Value(s)} & Description \tabularnewline\hline
navitab & UseNone,\,UseOutlines, UseThumbs,\,UseOC, UseAttachments
& The UI for these are: Page Only, Bookmarks Panel and Page, Pages Panel and Page, Layers Panel and Page, Attachments Panel and Page, respectively. The default is \texttt{UseNone}\tabularnewline
pagelayout & SinglePage,\,OneColumn, TwoPageLeft, TwoColumnLeft, TwoPageRight, TwoColumnRight
& The UI for these are: Single Page, Single Page Continuous, Two-Up (Facing), Two-Up Continuous (Facing), Two-Up (Cover Page), Two-Up Continuous (Cover Page), respectively. The default is user's preferences.\tabularnewline
mag & ActualSize,\,FitPage, FitWidth,\,FitHeight, FitVisible, \textrm{or}\ \anglemeta{pos~num}
& The UI for these are: Actual Size, Fit Page, Fit Width, Fit Height, Fit Visible, respectively. If a positive number is provided, this is interpreted as a magnification percentage. The default is to use user's preferences.\tabularnewline
openatpage & \anglemeta{pos~num}
& The page number (base 1) to open the document at. Default is page 1.\tabularnewline\hline
\end{tabular}
\end{small}%
\newtopic\textbf{\textcolor{red}{Important:}} When you set
\texttt{openatpage} to a page number other than the first page, be
aware that document level JavaScripts are initially imported into the
document on the first page. After the file is distilled and the
document opens to the page set by \texttt{openatpage}, the document
author needs to go to page 1, at which point the document level
JavaScripts will be imported. After import, \emph{save the document},
which will save the newly imported JavaScripts with the document.
\item \texttt{windowoptions}: The Window Options region of the
Initial View tab consists of a series of check boxes which, when
checked, modify the initial state of the document window. These are
not really Boolean keys. If the key is present, the
corresponding box in the UI will be checked, otherwise, the box
remains cleared.
\newtopic\begingroup\setlength{\extrarowheight}{2pt}%
\begin{tabular}{|>{\ttfamily}lp{2in}|}\hline
Key & Description \\\hline
fit & Resize window to initial page\\
center & Center window on screen \\
fullscreen & Open in Full Screen mode\\
showtitle & Show document title in the title bar\\\hline
\end{tabular}\endgroup
\newtopic Note that you can open the document in Full Screen mode using
the \texttt{fullscreen} key above, or by using the
\texttt{fullscreen} key of the \cs{setDefaultFS}. Either will
work.
\item \texttt{uioptions}: The User Interface Options region of
the Initial View tab consists of a series of check boxes which,
when checked, hide an UI control. These are not really Boolean
keys. If the key is present, the corresponding box in the UI
will be checked, otherwise, the box remains cleared.
\newtopic\begingroup\setlength{\extrarowheight}{2pt}%
\begin{tabular}{|>{\ttfamily}lp{2in}|}\hline
Key & Description \\\hline
hidemenubar & Hide menu bar\\
hidetoolbar & Hide tool bars\\
hidewindowui & Hide window controls\\\hline
\end{tabular}\endgroup
\end{itemize}
\textbf{\color{red}Important:} The \pkg{hyperref} package can set some of
these fields of the \uif{Initial View} tab
(\hyperref[docprops]{Figure~\ref*{docprops}}). The document author is
\emph{discouraged} from using \pkg{hyperref} to set any of these fields,
though, usually they are overwritten by this package.
\Ex{} We set the Initial View tab of the Document Properties dialog
box.
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily uioptions=\darg{hidetoolbar,hidemenubar,hidewindowui}}%
\begin{dCmd*}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\DeclareInitView
{%
layoutmag={mag=ActualSize,navitab=UseOutlines,%
openatpage=3,pagelayout=TwoPageLeft},
windowoptions={fit,center,showtitle,fullscreen},
uioptions={hidetoolbar,hidemenubar,hidewindowui}
}
\end{dCmd*}
\egroup
\exSrc{aebpro_ex7}The file \texttt{aebpro\_ex7} is a test file for the
features of this section. Use it to explore the properties of the
\uif{Initial View} tab (\hyperref[docprops]{Figure~\ref*{docprops}}) of the
\uif{Document Properties} dialog box.
\begin{figure}[ht]\centering
\includegraphics[scale=0.5]{docprops}
\caption{Initial View of Document Properties}\label{docprops}
\end{figure}
\newtopic\indent
\cs{DeclareInitView} is a companion command to \cs{DeclareDocInfo}.
Each fills in a separate tab of the Document Properties dialog box.
Use the package \Index{aebxmp} to fill in advance metadata through
\cs{DeclareDocInfo}. The \cs{DeclareInitView} commands populates
the \uif{Initial View} tab of the \uif{Document Properties} dialog box,
shown in \hyperref[docprops]{Figure~\ref*{docprops}}.
\section{Document Actions}
In this section we outline the various commands and environments for
creating document and page actions for a PDF document.
\subsection{Document Level JavaScripts}
The creation of document level JavaScript has been a part of {\AEB} for many
years, use the \texttt{insDLJS} environment, as documented in
\texttt{aeb\_man.pdf}.
\exPDFSrc{aebpro_ex1} The document \texttt{aebpro\_ex1} offers an
example of the use of the \texttt{insDLJS} environment.
\subsection{Set Document Actions}
The {\cAEBP} provides environments for the \textsf{Acrobat} events
\Index{willClose}, \Index{willSave}, \Index{didSave}, \Index{willPrint}
and \Index{didPrint}. Corresponding {\LaTeX} environments are created:
\texttt{willClose}, \texttt{willSave}, \texttt{didSave},
\texttt{willPrint} and \texttt{didPrint}.
\exPDFSrc{aebpro_ex1} The example document \texttt{aebpro\_ex1}
includes examples of the use of the \texttt{willClose},
\texttt{will\-Save}, \texttt{didSave}, \texttt{willPrint} and
\texttt{didPrint} environments
\settowidth{\aebdimen}{\ttfamily\string\begin\darg{willClose}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{willClose}
!anglemeta(script)
\end{willClose}
\end{dCmd}
\EnvDescription The JS code in the body of the \texttt{willClose}
environment will execute just before the document closes.
\EnvLoc Place this environment in the preamble.
\settowidth{\aebdimen}{\ttfamily\string\begin\darg{willSave}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{willSave}
!anglemeta(script)
\end{willSave}
\end{dCmd}
\EnvDescription The JS code in the body of the \texttt{willSave}
environment will execute just before the document is saved.
\EnvLoc Place this environment in the preamble.
\settowidth{\aebdimen}{\ttfamily\string\begin\darg{didSave}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{didSave}
!anglemeta(script)
\end{didSave}
\end{dCmd}
\EnvDescription The JS code in the body of the \texttt{didSave}
environment will execute just after the document is saved.
\EnvLoc Place this environment in the preamble.
\settowidth{\aebdimen}{\ttfamily\string\begin\darg{willPrint}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{willPrint}
!anglemeta(script)
\end{willPrint}
\end{dCmd}
\EnvDescription The JS code in the body of the \texttt{willPrint}
environment will execute just before the document is Printed.
\EnvLoc Place this environment in the preamble.
\settowidth{\aebdimen}{\ttfamily\string\begin\darg{didPrint}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{didPrint}
!anglemeta(script)
\end{didPrint}
\end{dCmd}
\EnvDescription The JS code in the body of the \texttt{didPrint}
environment will execute just after the document is Printed.
\EnvLoc Place this environment in the preamble.
\paragraph*{\textcolor{red}{Developer Notes:}}
I've inserted five commands,
\settowidth{\aebdimen}{\ttfamily\string\developer@will@Print}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\developer@will@Close
\developer@will@Save
\developer@did@Save
\developer@will@Print
\developer@did@Print
\end{dCmd}
that are let to \cs{@empty}. A package developer can insert JS code to make the package
behave as desired, while the document author can use the above environments to add any
additional scripts.
The correct way of using these commands is
\begin{Verbatim}[xleftmargin=\amtIndent,commandchars=!()]
\begin{defineJS}{\my@WillClose}
!anglemeta(some willClose script)
\end{defineJS}
\let\my@save@developer@will@Close\developer@will@Close
\def\developer@will@Close{%
\my@save@developer@will@Close
\my@WillClose
}
\end{Verbatim}
This is the technique I used in the \textsf{acroflex} package.
\subsection{Document Open Actions}
You can set an action to be performed when the document is opened,
independently of the page the document is opened at.
\settowidth{\aebdimen}{\ttfamily\string\additionalOpenAction\darg{\meta{action}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\additionalOpenAction{!meta(action)}
\end{dCmd}
\CmdDescription The \meta{action} can be any type of action described in the
\emph{PDF Reference}, but it is usually a JavaScript action.
\CmdLoc Place this command in the preamble.
The following example gets the time the user first opens the document,
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily\small var timestamp = util.printd("mm-dd-yy, H:MM:ss.", new Date());\}\}}%
\begin{dCmd*}[fontsize=\small,commandchars=!@~]{\aebdimen+2\fboxsep+2\fboxrule}
\additionalOpenAction{\JS{%
var timestamp = util.printd("mm-dd-yy, H:MM:ss.", new Date());}}
\end{dCmd*}
\egroup
\noindent\textcolor{red}{\textbf{Important:}} This open action takes place rather
early in document initialization, before the document level JavaScript is
scanned; therefore, the \meta{action} should not reference any
document level JavaScript, as at the time of the action, they are still
undefined. You are restricted to core JavaScript and the JavaScript API
for \textsf{Acrobat}.
\newtopic Using layers put a natural restriction on the version that
can be used to effectively view the document. To put a requirement on the
viewer to be used, use the \cs{re\-quires\-Version} command.
\settowidth{\aebdimen}{\ttfamily\string\requiresVersion[\meta{option}]\darg{\meta{version\_number}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\requiredVersionMsg{!meta(message)}
\alternateDocumentURL{!meta(url)}
\requiredVersionMsgRedirect{!meta(message)}
\afterRequirementPassedJS{!meta(JS code)}
\requiresVersion[!meta(option)]{!meta(version_number)}
\end{dCmd}
\CmdLoc Place these commands in the preamble.
\CmdDescription For \cs{requiresVersion}, the parameter
\meta{version\_number} is the minimal version number that this
document is made for. If the version number of the viewer is less
than \meta{version\_number}, an alert box appears, and the
document is silently closed, if outside a browser, or redirected, if
inside a browser. If the keyword \texttt{warnonly} is passed as the
value of the optional parameter, the alert messages will appear, but
the file will not be closed or redirected.
\newtopic\textcolor{red}{\textbf{Important:}} The command \cs{requiresVersion}
needs to be issued \emph{after} any redefinitions of the
\begin{gather*}
\cs{afterRequirementPassedJS},\ \cs{requiredVersionMsgRedirect},\\
\cs{requiredVersionMsg}, \text{ and } \cs{alternateDocumentURL}
\end{gather*}
When the document is opened outside a web browser and the version
number requirement is not met, the message contained in
\cs{requiredVersionMsg} appears in an alert box. The default
definition is
\begin{Verbatim}[xleftmargin=\amtIndent]
\requiredVersionMsg{%
This document requires Adobe Reader or Acrobat,
version \requiredVersionNumber\space or later.
The document is now closing.}
\end{Verbatim}
The argument of \cs{requiresVersion} is contained in \cs{requireVersionNumber},
and this macro should be used in the message, as illustrated above.
When the document is opened in a browser and the version number requirement is not met
the message contained in \cs{requiredVersionMsgRedirect} appears in an alert box. The
default definition is
\begin{Verbatim}[xleftmargin=\amtIndent]
\requiredVersionMsgRedirect{%
This document requires Adobe Reader or Acrobat,
version \requiredVersionNumber\space or later.
Redirecting browser to an alternate page.}
\end{Verbatim}
The browser is redirected to the URL specified in the argument of
\cs{alternateDoc\-u\-ment\-URL}, the default definition of which is
\begin{Verbatim}[xleftmargin=\amtIndent]
\alternateDocumentURL{http://www.acrotex.net/}
\end{Verbatim}
\newtopic The command \cs{requiresVersion} uses \cs{additionalOpenAction}; if you want
to combine several actions, including an action for checking for the version number, use
\cs{afterRe\-quire\-ment\-PassedJS}. For example,
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily\small var timestamp = util.printd("mm-dd-yy, H:MM:ss.", new Date());\}\}}%
\begin{dCmd*}[fontsize=\small,commandchars=!@~]{\aebdimen+2\fboxsep+2\fboxrule}
\afterRequirementPassedJS
{%
var timestamp = util.printd("mm-dd-yy, H:MM:ss.", new Date());
}
\end{dCmd*}
\egroup\noindent The above code will be executed if the version requirement is passed.
You can use \cs{afterRequirementPassedJS}, for example, to put deadline to view the document; that is,
if the document is opened after a pre-selected date and time, the document should close
down (or redirected to an alternate web page).
\newtopic\textcolor{red}{\textbf{Important:}} When using {\AEBP} with the \texttt{uselayers} option, the minimum
required version is 7. Thus,
\begin{Verbatim}[xleftmargin=\amtIndent]
\requiresVersion{7}
\end{Verbatim}
should be issued in the preamble of any document that uses layers.
\section{Page Actions}
When a page opens or closes a JavaScript occurs. Predefined
JavaScript can execute in reaction to these events. {\cAEBP}
provides several commands and environments.
\exPDFSrc{aebpro_ex1} The commands and environments described in
this section are illustrated in the support document
\texttt{aebpro\_ex1}.
\subsection{Open/Close Page Actions for First Page}
Because of the way {\AEB} was originally written---\textsf{exerquiz},
actually---, the first page is a special case.
There is a command, \cs{OpenAction}, that is part of the
\texttt{insdljs} package for several years, that is used to
introduce open page actions:
\settowidth{\aebdimen}{\ttfamily\string\OpenAction\darg{\string\JS\darg{\meta{script}}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\OpenAction{\JS{!meta(script)}}
\end{dCmd}
\CmdLoc This command goes in the preamble to define action for the
first page. This command is capable of defining non-JavaScript
action, see the documentation of \texttt{insdljs} for some details.
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily\small console.println("Show the output of the page actions");}%
\begin{dCmd*}[fontsize=\small,commandchars=!@~]{\aebdimen+2\fboxsep+2\fboxrule}
\OpenAction{\JS{%
console.show();\r
console.clear();\r
console.println("Show the output of the page actions");
}}
\end{dCmd*}
\egroup
In addition to \cs{OpenAction}, \texttt{addJSToPageOpen} and
\texttt{addJSToPageClose} are also defined by {\cAEBP}. The
\meta{script} is executed each time the page is opened or
closed.
\settowidth{\aebdimen}{\ttfamily\string\begin\darg{addJSToPageOpen}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{addJSToPageOpen}
!anglemeta(script)
\end{addJSToPageOpen}
\end{dCmd}
For page close events, we have the \texttt{addJSToPageClose}
environment.
\settowidth{\aebdimen}{\ttfamily\string\begin\darg{addJSToPageClose}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{addJSToPageClose}
!anglemeta(script)
\end{addJSToPageClose}
\end{dCmd}
\EnvDescription When placed in the preamble, these provide
JavaScript support for page open/close events of the first page.
Below are examples of usage. These appear in the document
\texttt{aebpro\_ex1}.
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily\small{console.println(str + ": page " + (this.pageNum+1));}}%
\begin{dCmd*}[fontsize=\small]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{addJSToPageOpen}
var str = "This should be the first page";
console.println(str + ": page " + (this.pageNum+1));
\end{addJSToPageOpen}
\end{dCmd*}
\egroup
\noindent and
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily\small{var str = "This is the close action for the first page!";}}%
\begin{dCmd*}[fontsize=\small]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{addJSToPageClose}
var str = "This is the close action for the first page!";
console.println(str + ": page " + (this.pageNum+1));
\end{addJSToPageClose}
\end{dCmd*}
\egroup
\subsection{Open/Close Page Actions for the other Pages}\label{pageactions}
The same two environments \texttt{addJSToPageOpen} and
\texttt{addJSToPageClose} can be used in the body of the text to
generate open or close actions for the page on which they appear.
It's a rather hit or miss proposition because the tex compiler may
break the page at an unexpected location and the environments are
processed on the page following the one you wanted them to appear
on.
\settowidth{\aebdimen}{\ttfamily\string\begin\darg{addJSToPageOpen}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{addJSToPageOpen}
!anglemeta(script)
\end{addJSToPageOpen}
\end{dCmd}
\settowidth{\aebdimen}{\ttfamily\string\begin\darg{addJSToPageClose}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{addJSToPageClose}
!anglemeta(script)
\end{addJSToPageClose}
\end{dCmd}
\EnvDescription Place on the page that these actions are to apply.
\newtopic Another approach to trying to place
\texttt{addJSToPageOpen} or \texttt{addJSTo\-Page\-Close} on the
page you want is to use the \texttt{addJSToPageOpenAt} or
\texttt{addJSToPageCloseAt} environments. These are the same as
their cousins, but are more powerful. Each of these takes an
argument that specifies the page, pages, and/or page ranges of the
open/close effects you want.
\settowidth{\aebdimen}{\ttfamily\string\begin\darg{addJSToPageOpenAt}\darg{\meta{page-ranges}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{addJSToPageOpenAt}{!meta(page-ranges)}
!anglemeta(script)
\end{addJSToPageOpenAt}
\end{dCmd}
\noindent For page close events, we have the \texttt{addJSToPageClose}
environment.
\settowidth{\aebdimen}{\ttfamily\string\begin\darg{addJSToPageCloseAt}\darg{\meta{page-ranges}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{addJSToPageCloseAt}{!meta(page-ranges)}
!anglemeta(script)
\end{addJSToPageCloseAt}
\end{dCmd}
\removelastskip\EnvLoc Place these just after \verb!\begin{document}! and before the
command \cs{maketitle}.
%\EnvDescription When placed in the preamble, these provide
%JavaScript support for page open/close events of the first page.
\PD The two environments take a comma-delimited list of pages and page
ranges, for example, an argument might be \verb!{2-6,9,12,15-}!.
This argument states that the open or close JavaScript listed in the
environment should execute on pages 2 through 6, page 9, page 11,
and pages 15 through the end of the document. Very cool!
This is all well and good if you know exactly which pages are the
ones you want the effects to appear. What's even more cool is that
you can use {\LaTeX}'s cross-referencing mechanism to specify the
pages. By placing these after \verb!\begin{document}!,
the cross referencing information (the \texttt{.aux}) has been input
and you can use \cs{atPage}, a special simplified version of
\cs{pageref}, to reference the pages.
below.
\settowidth{\aebdimen}{\ttfamily\string\atPage\darg{\meta{label}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\atPage{!meta(label)}
\end{dCmd}
\CmdDescription Returns the page number on which the {\LaTeX}
cross-reference label \meta{label} resides.
For example,
\settowidth{\aebdimen}{\ttfamily\string\begin\darg{addJSToPageOpenAt}\darg{1,\string\atPage]\darg{test}-\string\atPage\darg{exam}}}%
\begin{dCmd*}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{addJSToPageOpenAt}{1,\atPage{test}-\atPage{exam}}
var str = "Add to open page at pages between "
+ "\\\\atPage{test} and \\\\atPage{exam} "
+ (this.pageNum+1);
console.println(str);
\end{addJSToPageOpenAt}
\end{dCmd*}
In the above, we specify a range \verb!\atPage{test}-\atPage{exam}!.
If the first page number is larger than the second number, the two
numbers are switched; consequently, the specification
\verb!\atPage{exam}-\atPage{test}! yields the same results.
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily{var str = "Add to close page at page " + (this.pageNum+1);}}%
\begin{dCmd*}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{addJSToPageCloseAt}{5-8,12,15-}
var str = "Add to close page at page " + (this.pageNum+1);
console.println(str);
\end{addJSToPageCloseAt}
\end{dCmd*}
\egroup
In the above example, notice that in the \texttt{addJSToPageOpenAt}
environment above, page 1 was specified. This specification is
ignored. You do remember that the first page events need to be
defined in the preamble, don't you.
\subsection{Every Page Open/Close Events}
As an additional feature, there may be an occasion where you want to
define an event for every page. These are handled separately from
the earlier mentioned open/closed events so one does not overwrite
the other. These environments are \texttt{everyPageOpen} and
\texttt{everyPageClose}. They can go in the preamble, or anywhere.
They will take effect on the page they are processed on. Using
these environments a second time overwrites any earlier definition.
To cancel out the every page action you can use
\Com{canceleveryPageOpen} and \Com{canceleveryPageClose}.
\settowidth{\aebdimen}{\ttfamily\string\begin\darg{everyPageOpen}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{everyPageOpen}
!anglemeta(script)
\end{everyPageOpen}
\end{dCmd}
For page close events, we have the \texttt{everyPageClose} environment.
\settowidth{\aebdimen}{\ttfamily\string\begin\darg{everyPageClose}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{everyPageClose}
!anglemeta(script)
\end{everyPageClose}
\end{dCmd}
\EnvLoc Place in the preamble or in the body of the document.
For example,
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily{console.println(str + ": page " + (this.pageNum+1));}}%
\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule}
\begin{everyPageOpen}
var str = "every page open";
console.println(str + ": page " + (this.pageNum+1));
\end{everyPageOpen}
\end{dCmd*}
\egroup
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily{console.println(str + ": page " + (this.pageNum+1));}}%
\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule}
\begin{everyPageClose}
var str = "every page close";
console.println(str + ": page " + (this.pageNum+1));
\end{everyPageClose}
\end{dCmd*}
\egroup
\settowidth{\aebdimen}{\ttfamily\string\canceleveryPageClose}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\canceleveryPageOpen
\canceleveryPageClose
\end{dCmd}
\CmdDescription These two commands cancel the current \env{everyPageOpen} and
\env{everyPageClose} events. Following the cancel commands, use
the \env{everyPageOpen} or \env{everyPageClose} environment to create
different every page events.
\section{Fullscreen Support}\label{FSSupport}
In this section we present the controlling commands for default
fullscreen mode and for defining page transition effects.
\exPDFSrc{aebpro_ex1} The sample file \texttt{aebpro\_ex1}
demonstrates many of the full screen features described in this
section.
\subsection{Set Fullscreen Defaults:
\texorpdfstring{\protect\cs{setDefaultFS}}{\textbackslash setDefaultFS}}
Set the default fullscreen behavior of \textsf{Adobe
Reader}/\textsf{Acrobat} by using \cs{setDefaultFS} in the preamble. This
command takes a number of arguments using the \texttt{xkeyval} package.
Each key corresponds to a JavaScript property of the \texttt{Fullscreen}
object.
\settowidth{\aebdimen}{\ttfamily\string\setDefaultFS\darg{\meta{KV-pairs}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\setDefaultFS{!meta(KV-pairs)}
\end{dCmd}
The command for setting how you want to viewer to behave in fullscreen.
This command is implemented through JavaScript, as opposed to the
\textbf{pdfmark} operator. See \emph{JavaScript for Acrobat API Reference}
\cite{tech:AcroJSRef}, the section on the \texttt{FullScreen} object.
\CmdLoc This command must be executed in the preamble.
\KVP The command has numerous key-value pairs, the defaults of most
of these are set in the \texttt{Preferences} menu of the viewer.
These values are the ones listed in the \emph{Acrobat JavaScript
Scripting Reference} \cite{tech:AcroJSRef}.
\begin{enumerate}\raggedright
\item \texttt{Trans}: permissible values are
\texttt{NoTransition}, \texttt{UncoverLeft},
\texttt{UncoverRight}, \texttt{UncoverDown}, \texttt{UncoverUp},
\texttt{UncoverLeftDown}, \texttt{UncoverLeftUp},
\texttt{UncoverRightDown}, \texttt{UncoverRightUp},
\texttt{CoverLeft}, \texttt{CoverRight}, \texttt{CoverDown},
\texttt{CoverUp}, \texttt{CoverLeftDown}, \texttt{CoverLeftUp},
\texttt{CoverRightDown}, \texttt{CoverRightUp},
\texttt{PushLeft}, \texttt{PushRight}, \texttt{PushDown},
\texttt{PushUp}, \texttt{PushLeftDown}, \texttt{PushLeftUp},
\texttt{PushRightDown}, \texttt{PushRightUp},
\texttt{FlyInRight}, \texttt{FlyInLeft}, \texttt{FlyInDown},
\texttt{FlyInUp}, \texttt{FlyOutRight}, \texttt{FlyOutLeft},
\texttt{FlyOutDown}, \texttt{FlyOutUp}, \texttt{FlyIn},
\texttt{FlyOut}, \texttt{Blend}, \texttt{Fade}, \texttt{Random},
\texttt{Dissolve}, \texttt{GlitterRight}, \texttt{GlitterDown},
\texttt{GlitterRightDown}, \texttt{BoxIn}, \texttt{BoxOut},
\texttt{BlindsHorizontal}, \texttt{BlindsVertical},
\texttt{SplitHorizontalIn}, \texttt{SplitHorizontalOut},
\texttt{SplitVerticalIn}, \texttt{SplitVerticalOut},
\texttt{WipeLeft}, \texttt{WipeRight}, \texttt{WipeDown},
\texttt{WipeUp}, \texttt{WipeLeftDown}, \texttt{WipeLeftUp},
\texttt{WipeRightDown}, \texttt{WipeRightUp}, \texttt{Replace},
\texttt{ZoomInDown}, \texttt{ZoomInLeft},
\texttt{ZoomInLeftDown}, \texttt{ZoomInLeftUp},
\texttt{ZoomInRight}, \texttt{ZoomInRightDown},
\texttt{ZoomInRightUp}, \texttt{ZoomInUp}, \texttt{ZoomOutDown},
\texttt{ZoomOutLeft}, \texttt{ZoomOutLeftDown},
\texttt{ZoomOutLeftUp}, \texttt{ZoomOutRight},
\texttt{ZoomOutRightDown}, \texttt{ZoomOutRightUp},
\texttt{ZoomOutUp}, \texttt{CombHorizontal},
\texttt{CombVertical}. The default is \texttt{Replace}.
\item[] The following are new to \textsf{Acrobat}/\textsf{Adobe
Reader} version 8: \texttt{PushLeftDown}, \texttt{PushLeftUp},
\texttt{PushRightDown}, \texttt{PushRightUp},
\texttt{WipeLeftDown}, \texttt{WipeLeftUp},
\texttt{WipeRightDown}, \texttt{WipeRightUp},
\texttt{ZoomInDown}, \texttt{ZoomInLeft},
\texttt{ZoomInLeftDown}, \texttt{ZoomInLeftUp},
\texttt{ZoomInRight}, \texttt{ZoomInRightDown},
\texttt{ZoomInRightUp}, \texttt{ZoomInUp},
\texttt{ZoomOutDown}, \texttt{ZoomOutLeft},
\texttt{ZoomOutLeftDown}, \texttt{ZoomOutLeftUp},
\texttt{ZoomOutRight}, \texttt{ZoomOutRightDown},
\texttt{ZoomOutRightUp}, \texttt{ZoomOutUp},
\texttt{CombHorizontal}, \texttt{CombVertical}
\rightskip=0pt
\item[] The transition chosen by this key will be in effect for each page that does not
have a transition effect separately defined for it (by the \Com{setPageTransition} command).
\item \texttt{bgColor}: Sets the background color in fullscreen mode.
The color specified must be a JavaScript Color array, e.g.,
\verb!bgColor={["RGB",0,1,0]}!, or you can use some preset colors,
\verb!bgColor = color.ltGray!.
\item \texttt{timeDelay}: The default number of seconds before the
page automatically advances in full screen mode. See
\texttt{useTimer} to activate/deactivate automatic page turning.
\item \texttt{useTimer}: A Boolean that determines whether automatic
page turning is enabled in full screen mode. Use \texttt{timeDelay} to set
the default time interval before proceeding to the next page.
\item \texttt{loop}: A Boolean that determines whether the document will loop around back
to the first page.
\item \texttt{cursor}: Determines the behavior of the mouse in full screen mode. Permissible
values are \texttt{hidden}, \texttt{delay} (hidden after a short delay) and \texttt{visible}.
\item \texttt{escape}: A Boolean use to determine if the escape key will cause the viewer
to leave full screen mode.
\item \texttt{clickAdv}: A Boolean that determines whether a mouse click on the page will
cause the page to advance.
\item \texttt{fullscreen}: A Boolean, which if \texttt{true}, causes the viewer to go into
full screen mode. Has no effect from within a browser.
\item \texttt{usePageTiming}: A Boolean that determines whether
automatic page turning will respect the values specified for
individual pages in full screen mode (which can be set through
\Com{setPageTransition}).
\end{enumerate}
This example causes the viewer to go into full screen mode,
sets the transition to \texttt{Random}, instructs the viewer to loop
back around to the first page, and to make the cursor hidden after a
short period of inactivity.
\settowidth{\aebdimen}{\ttfamily\string\setDefaultFS\darg{fullscreen,Trans=Random,loop,cursor=delay,escape}}%
\begin{dCmd*}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\setDefaultFS{fullscreen,Trans=Random,loop,cursor=delay,escape}
\end{dCmd*}
On closing the document, the user's original full screen preferences
are restored.
\newtopic In the preamble of this document, I have placed
\cs{setDefaultFS} specifying that the document should go into
fullscreen mode with a random transition for its default transition
effect.
\subsection{Page Transition Effects}
The \Com{setDefaultFS} command can set the full screen behavior of
the viewer for the \emph{entire document}, including a transition
effect applicable to all pages in the document; for transition
effects of individual pages, use the \cs{setPageTransition} command.
\settowidth{\aebdimen}{\ttfamily\string\setPageTransition\darg{\meta{KV-pairs}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\setPageTransition{!meta(KV-pairs)}
\end{dCmd}
Sets the transition effect for the \emph{next page only}, viewer must be
in full screen mode. The command \cs{setPageTransition} is implemented
using the \textbf{pdfmark} operator.
\CmdLoc This command should be used in the preamble for the first page,
and between slides for subsequent pages.
\KVP The \Com{setPageTransition} command has several key-value pairs:
\begin{enumerate}\raggedright
\item \texttt{Trans}: permissible values are
\texttt{NoTransition}, \texttt{UncoverLeft},
\texttt{UncoverRight}, \texttt{UncoverDown}, \texttt{UncoverUp},
\texttt{UncoverLeftDown}, \texttt{UncoverLeftUp},
\texttt{UncoverRightDown}, \texttt{UncoverRightUp},
\texttt{CoverLeft}, \texttt{CoverRight}, \texttt{CoverDown},
\texttt{CoverUp}, \texttt{CoverLeftDown}, \texttt{CoverLeftUp},
\texttt{CoverRightDown}, \texttt{CoverRightUp},
\texttt{PushLeft}, \texttt{PushRight}, \texttt{PushDown},
\texttt{PushUp}, \texttt{PushLeftDown}, \texttt{PushLeftUp},
\texttt{PushRightDown}, \texttt{PushRightUp},
\texttt{FlyInRight}, \texttt{FlyInLeft}, \texttt{FlyInDown},
\texttt{FlyInUp}, \texttt{FlyOutRight}, \texttt{FlyOutLeft},
\texttt{FlyOutDown}, \texttt{FlyOutUp}, \texttt{FlyIn},
\texttt{FlyOut}, \texttt{Blend}, \texttt{Fade}, \texttt{Random},
\texttt{Dissolve}, \texttt{GlitterRight}, \texttt{GlitterDown},
\texttt{GlitterRightDown}, \texttt{BoxIn}, \texttt{BoxOut},
\texttt{BlindsHorizontal}, \texttt{BlindsVertical},
\texttt{SplitHorizontalIn}, \texttt{SplitHorizontalOut},
\texttt{SplitVerticalIn}, \texttt{SplitVerticalOut},
\texttt{WipeLeft}, \texttt{WipeRight}, \texttt{WipeDown},
\texttt{WipeUp}, \texttt{WipeLeftDown}, \texttt{WipeLeftUp},
\texttt{WipeRightDown}, \texttt{WipeRightUp}, \texttt{Replace},
\texttt{ZoomInDown}, \texttt{ZoomInLeft},
\texttt{ZoomInLeftDown}, \texttt{ZoomInLeftUp},
\texttt{ZoomInRight}, \texttt{ZoomInRightDown},
\texttt{ZoomInRightUp}, \texttt{ZoomInUp}, \texttt{ZoomOutDown},
\texttt{ZoomOutLeft}, \texttt{ZoomOutLeftDown},
\texttt{ZoomOutLeftUp}, \texttt{ZoomOutRight},
\texttt{ZoomOutRightDown}, \texttt{ZoomOutRightUp},
\texttt{ZoomOutUp}, \texttt{CombHorizontal},
\texttt{CombVertical}. The default is \texttt{Replace}.
\item[] The following are new to \textsf{Acrobat}/\textsf{Adobe
Reader}, version 8: \texttt{PushLeftDown},
\texttt{PushLeftUp}, \texttt{PushRightDown},
\texttt{PushRightUp}, \texttt{WipeLeftDown},
\texttt{WipeLeftUp}, \texttt{WipeRightDown},
\texttt{WipeRightUp}, \texttt{ZoomInDown},
\texttt{ZoomInLeft}, \texttt{ZoomInLeftDown},
\texttt{ZoomInLeftUp}, \texttt{ZoomInRight},
\texttt{ZoomInRightDown}, \texttt{ZoomInRightUp},
\texttt{ZoomInUp}, \texttt{ZoomOutDown}, \texttt{ZoomOutLeft},
\texttt{ZoomOutLeftDown}, \texttt{ZoomOutLeftUp},
\texttt{ZoomOutRight}, \texttt{ZoomOutRightDown},
\texttt{ZoomOutRightUp}, \texttt{ZoomOutUp},
\texttt{CombHorizontal}, \texttt{CombVertical}
\rightskip=0pt
\item[] These values are the ones listed in the \emph{Acrobat
JavaScript Scripting Reference} \cite{tech:AcroJSRef}.
\item \texttt{TransDur}: Duration of the transition effect, in
seconds. Default value: 1.
\item \texttt{Speed}: Same as \texttt{TransDur}, the duration of
the transition effect, except this key takes values
\texttt{Slow}, \texttt{Medium} or \texttt{Fast}, corresponding
to the \textsf{Acrobat} UI. If \texttt{TransDur} and
\texttt{Speed} are both specified, Speed is used. Use
\texttt{TransDur} for finer granularity.
\item \texttt{PageDur}: The \emph{PDF Reference, version 1.6}
\cite{tech:PDFRef}, describes this as ``The page's display
duration (also called its advance timing): the maximum
length of time, in seconds, that the page is displayed
during presentations before the viewer application
automatically advances to the next page. By default, the
viewer does not advance automatically.''
\end{enumerate}
For example,
\settowidth{\aebdimen}{\ttfamily\string\setPageTransition\darg{Trans=Blend,PageDur=20,TransDur=5}}%
\begin{dCmd*}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\setPageTransition{Trans=Blend,PageDur=20,TransDur=5}
\end{dCmd*}
\cs{setPageTransition} suffers from the same malady as
do \texttt{addJSToPage\-Open} and \texttt{addJSToPageClose}, it has
to be placed on the page you want to apply. For this reason, there
is the \cs{setPageTransitionAt}.
\settowidth{\aebdimen}{\ttfamily\string\setPageTransitionAt\darg{\meta{page-ranges}}\darg{\meta{KV-pairs}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\setPageTransitionAt{!meta(page-ranges)}{!meta(KV-pairs)}
\end{dCmd}
\KVP Same as \cs{setPageTransitionAt}
\PD The parameter \meta{page-ranges} has the same format as
described in \hyperref[pageactions]{Section~\ref*{pageactions}},
page~\pageref*{pageactions}. This command obeys the \cs{atPage}.
For example,
\settowidth{\aebdimen}{\ttfamily\string\setPageTransitionAt\darg{1,\string\atPage\darg{test}-\string\atPage\darg{exam},7}}%
\begin{dCmd*}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\setPageTransitionAt{1,\atPage{test}-\atPage{exam},7}
{Trans=Blend,PageDur=20,TransDur=5}
\end{dCmd*}
\section{Attaching Documents}
{\cAEBP} has two options for attaching files to the source PDF. The
approach is the \texttt{import\-Data\-Object} JavaScript method in
conjunction with the FDF techniques.
There are two options for attaching files
\begin{enumerate}
\item \texttt{attachsource} is a simplified option for attaching
a file with the same base name as \cs{jobname}, that is a file
of the form \cs{jobname.}\texttt{\textsl{ext}}.
\item \texttt{attachments} is a general option for attaching a
file, as specified by its absolute or relative path.
\end{enumerate}
\exPDFSrc{aebpro_ex3} The file \texttt{aebpro\_ex3} demonstrates many
of the commands presented in this section.
\subsection{The \texttt{attachsource} option}\label{attachsource}
Use this option to attach a file with the same base name as \cs{jobname}.
\begin{Verbatim}[xleftmargin=\amtIndent]
\usepackage[%
driver=dvips,
web={
pro,
...
usesf
},
attachsource={tex,dvi,log,tex.log},
...
]{aeb_pro}
\end{Verbatim}
Simply list the extensions you wish to attach to the current document. In
the example above, we attach the original source file \cs{jobname.tex},
\cs{jobname.dvi}, \cs{jobname.log} (the \textsf{Distiller} log) and
\cs{jobname.tex.log} (the tex log).
\newtopic One problem with attaching the log file is that the \textsf{Distiller} also
produces a log file with the same name \cs{jobname.log}. Consequently, the
log file for the tex file is overwritten by the \textsf{Distiller} log
file. You'll see from the PDF document, that the log file attached is the
one for the \textsf{Distiller}.
\newtopic A work around for this is to latex your file, rename the
log file to another extension, such as \cs{jobname.tex.log}, then
distill. You may want to send that log file so some poor \TeX pert for
\TeX pert analysis!
\subsection{The \texttt{attachments} option}\label{attachments}
The \texttt{attachments} key is for attaching files other than ones
associated with the source file. The value of this key is a
comma-delimited list (enclosed in braces) of absolute paths and/or
relative paths to the file required to attach. For example,
\begin{Verbatim}[xleftmargin=\amtIndent]
\usepackage[%
driver=dvips,
web={
pro,
...
usesf
},
attachments={robot man/robot_man.pdf,%
/C/Documents and Settings/dps/My Documents/birthday17.jpg},
...
]{aeb_pro}
\end{Verbatim}
The first reference is relative to the folder that this source file
is contained in (and is attached to this PDF), and second one is an
example of an absolute path.
\Important There are some files that \textsf{Acrobat} does not attach, but
there is no public list of these. One finds them by discovery,
\texttt{.exe} and \texttt{.zip} files, for example.
A trick that I use to send \texttt{.zip} files through the email (they are
often stripped away by mail servers) is to \emph{hide} the \texttt{.zip}
file in a PDF as an attachment. But since \textsf{Acrobat} does not attach
\texttt{.zip}, I change the extension from \texttt{.zip} to \texttt{.txt},
then inform the recipient to save the \texttt{.txt} file and change the
extension back to \texttt{.zip}. Swave!
\subsection{Optional attachments}
The \texttt{attachments} options allows you to list a collection of files
to be attached to the PDF file. The optional attachments concept allows
you to develop a list of attachments that are attached if the
\texttt{optattachments} option is taken and not attached if the
\texttt{!optattachments} option is taken. {\AEBP} defines
\cs{ifoptattachments}, a Boolean switch, which is set to true by
\texttt{optattachments} and to false by \texttt{!optattachments}.
\settowidth{\aebdimen}{\ttfamily\string\addtoOptAttachments\darg{\meta{list\_of\_files}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\addtoOptAttachments{!meta(list_of_files)}
\end{dCmd}
This command can be used anywhere in the document and adds the listed
files to the ones to be attached. The list is comma delimited.
The initial application and motivation of this feature is for projects
that are worked on by a team of {\LaTeX} authors. The master project file
inputs sections of the document using the \cs{input} command of {\LaTeX}.
The request was for any file that is input using \cs{input} be added to
the optional attachments list; therefore, the {\AEBP} package defines the
following two commands:
\settowidth{\aebdimen}{\ttfamily\string\prjinclude\darg{\meta{file}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\prjinput{!meta(file)}
\prjinclude{!meta(file)}
\end{dCmd}
These are the ``project'' version of the {\LaTeX} commands \cs{input} and
\cs{include}, respectively. Each of these adds \meta{file} to the list
of optional attachments, then passes the argument to the two user commands
\cs{prjInputUser} and \cs{prjIncludeUser}, respectively.
\settowidth{\aebdimen}{\ttfamily\string\newcommand\darg{\string\prjIncludeUser}[1]\darg{\string\include\darg{\#1}}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\newcommand{\prjInputUser}[1]{\input{#1}}
\newcommand{\prjIncludeUser}[1]{\include{#1}}
\end{dCmd}
Above you see the default definitions of these user commands. They may be
redefined as desired to achieve some special effect.
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily \string\marginpar\darg{\string\fbox\darg{\string\footnotesize\string\ttfamily\#1}}}%
\begin{dCmd*}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\renewcommand{\prjInputUser}[1]{%
\marginpar{\fbox{\footnotesize\ttfamily#1}}
\input{#1}}
\end{dCmd*}
\egroup
It is possible to define \cs{prjInputUser} to be a link or button that
opens the attached file.
When the \texttt{!optattachments} is taken, the default definitions of the
two commands \cs{prjinput} and \cs{prjinclude} are \cs{prjInputUser} and
\cs{prjIncludeUser}, respectively; this bypasses the step of adding the file
to the list of optional attachments. The switch \cs{ifoptattachments} can be
used, as needed, in a custom definition of \cs{prjInputUser} or
\cs{prjIncludeUser}; for example,
\bgroup\obeyspaces%
\settowidth{\aebdimen}{ \ttfamily\string\marginpar%
\darg{\string\fbox\darg{\string\footnotesize\string\ttfamily\string\ifoptattachments}}}%
\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule}
\renewcommand{\prjInputUser}[1]{%
\marginpar{\fbox{\footnotesize\ttfamily\ifoptattachments
\setLink[\A{\JS{this.exportDataObject({%
cName: "\getcNameFromFileName{#1}",nLaunch: 0});}}
]{\textcolor{\ahrefcolor}{#1}}\else#1\fi}}\input{#1}}
\end{dCmd*}
\egroup This code creates a link that saves the attachment, if
\texttt{optattachments} is taken, and simply puts the file name the margin,
if \texttt{!optattachments} is taken. The JavaScript method
\texttt{this.exportDataObject} is used to extract and save the attachment;
the command \cs{getcNameFromFileName} is an {\AEBP} command that associates
the file name (\texttt{\#1}) with the attachment label name (the
\texttt{cName} key).
\section{Doc Assembly Methods}\label{docassembly}
Ahhhh, document assembly. What can be said? This is a method that I
have used for many years and is incorporated into the
\textsf{insdljs} package under the name of \texttt{execJS}. Whereas
the \texttt{execJS} environment is still available to you, I've
simplified things. The term doc assembly refers to the use of the
\texttt{docassembly} environment (which is just an \texttt{execJS}
environment).
\settowidth{\aebdimen}{\ttfamily\string\begin\darg{docassembly}}%
\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{docassembly}
!anglemeta(script)
\end{docassembly}
\end{dCmd}
\noindent
The \texttt{execJS}/\texttt{docassembly} environments create an FDF file
with the various JavaScript commands that were contained in the body of
the environment. These environments also place in open page action so that
when the PDF is opened for the first time in \textsf{Acrobat Pro}, the FDF
file will be imported and the \anglemeta{script} is \emph{executed one time and then
discarded}, see \cite{TUG:execJS} for an article on this topic. This
technique only works if you have \textsf{Acrobat Pro}.
\subsection{Certain Security Restricted JS Methods}
In addition to the \texttt{docassembly} environment, {\cAEBP} also
has several macros that expand to JavaScript methods that I find
useful. These JavaScript methods are quite useful, yet they have a \emph{security
restriction} on them; they cannot be executed from within a document, and certainly
not by Adobe Reader.
The use of these methods requires the installation of
\texttt{aeb\_pro.js}, the folder level JavaScript file that comes
with this package. These methods are normally called from the
\texttt{docassembly} environment.
\settowidth{\aebdimen}{\ttfamily\string\addWatermarkFromFile(\darg{\meta{KV-pairs}});}%
\begin{dCmd}[commandchars={!@~}]{\aebdimen+2\fboxsep+2\fboxrule}
\addWatermarkFromFile({!meta@KV-pairs~});
\end{dCmd}
\CmdDescription Inserts a watermark into the PDF
\KVP Numerous, see the \texttt{addWatermarkFromFile()} method
\cite{tech:AcroJSRef}. Here, we mention only two.
\begin{enumerate}
\item \texttt{cDIPath}: The absolute path to the background or watermark document.
\item \texttt{bOnTop}: (optional) A Boolean value specifying the
z-ordering of the watermark. If \texttt{true} (the default), the watermark
is added above all other page content. If \texttt{false}, the watermark is
added below all other page content.
\end{enumerate}
\settowidth{\aebdimen}{\ttfamily\string\importIcon(\darg{\meta{KV-pairs}});}%
\begin{dCmd}[commandchars={!@~}]{\aebdimen+2\fboxsep+2\fboxrule}
\importIcon({!meta@KV-pairs~});
\end{dCmd}
\CmdDescription Imports icon files\footnote{The AcroMemory package uses these
environments and functions to import icons.}
\KVP There are three key-value pairs:
\begin{enumerate}
\item \texttt{cName}: The name to associate with the icon
\item \texttt{cDIPath}: The path to the icon file, it may be absolute or relative
\item \texttt{nPage}: The 0-based index of the page in the PDF file to import as an icon. The
default is 0.
\end{enumerate}
\settowidth{\aebdimen}{\ttfamily\string\importSound(\darg{\meta{KV-pairs}});}%
\begin{dCmd}[commandchars={!@~}]{\aebdimen+2\fboxsep+2\fboxrule}
\importSound({!meta@KV-pairs~});
\end{dCmd}
\CmdDescription Imports a sound file
\KVP There are two key-value pairs:
\begin{enumerate}
\item \texttt{cName}: The name to associate with the sound object
\item \texttt{cDIPath}: The path to the sound file, it may be absolute or relative
\end{enumerate}
\settowidth{\aebdimen}{\ttfamily\string\appopenDoc(\darg{\meta{KV-pairs}});}%
\begin{dCmd}[commandchars={!@~}]{\aebdimen+2\fboxsep+2\fboxrule}
\appopenDoc({!meta@KV-pairs~});
\end{dCmd}
\CmdDescription Opens a document
\KVP Here, we list only two of five
\begin{enumerate}
\item \texttt{cPath}: A device-independent path to the document to be opened. If \texttt{oDoc} is specified, the
path can be relative to it. The target document must be accessible in the default file
system.
\item \texttt{oDoc}: (optional) A \texttt{Doc} object to use as a base to resolve a relative cPath. Must be
accessible in the default file system.
\end{enumerate}
\settowidth{\aebdimen}{\ttfamily\string\insertPages(\darg{\meta{KV-pairs}});}%
\begin{dCmd}[commandchars={!@~}]{\aebdimen+2\fboxsep+2\fboxrule}
\insertPages({!meta@KV-pairs~});
\end{dCmd}
\CmdDescription Inserts pages into the PDF, useful for
inserting pages of difference sizes, such as tables or figures,
into a {\LaTeX} document which requires that all page be of a
fixed size.
\KVP There are five key-value pairs:
\begin{enumerate}
\item \texttt{nPage}: (optional) The 0-based index of the page after which to insert the source document
pages. Use -1 to insert pages before the first page of the document.
\item \texttt{cPath}: The device-independent path to the PDF file that will provide the inserted pages. The
path may be relative to the location of the current document.
\item \texttt{nStart}: (optional) A 0-based index that defines the start of an inclusive range of pages in the
source document to insert. If only \texttt{nStart} is specified, the range of pages is the single page specified by nStart.
\item \texttt{nEnd}: (optional) A 0-based index that defines the end of an inclusive range of pages in the
source document to insert. If only \texttt{nEnd} is specified, the range of pages is 0 to \texttt{nEnd}.
\end{enumerate}
\settowidth{\aebdimen}{\ttfamily\string\importDataObject(\darg{\meta{KV-pairs}});}%
\begin{dCmd}[commandchars={!@~}]{\aebdimen+2\fboxsep+2\fboxrule}
\importDataObject({!meta@KV-pairs~});
\end{dCmd}
\CmdDescription Attaches a file to the PDF. This function is used in the two
attachments options of {\cAEBP}.
\KVP There are two key-value pairs of interest:
\begin{enumerate}
\item \texttt{cName}: The name to associate with the data object.
\item \texttt{cDIPath}: (optional) A device-independent path to a data file on the user’s hard drive. This path may be absolute or relative to the current document. If not
specified, the user is prompted to locate a data file.
\end{enumerate}
\settowidth{\aebdimen}{\ttfamily\string\executeSave();}%
\begin{dCmd}[commandchars={!@~}]{\aebdimen+2\fboxsep+2\fboxrule}
\executeSave();
\end{dCmd}
\CmdDescription As you know, you must always save your document
after it is distilled, this saves document JavaScripts in the
document. This command saves the current file so you don't have do
it yourself. This command should be the last one listed in the
\texttt{docassembly} environment.\footnote{Later commands may dirty the document again, and
I have found that saving the document can cause later commands, like \cs{addWatermarkFromFile},
not to execute.}
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily reason: "I am approving this document",}%
\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule}
\sigInfo{
cSigFieldName: "mySig",
ohandler: security.PPKLiteHandler,
cert: "D_P_Story.pfx",
password: "dps017",
oInfo: {
location: "Niceville, FL",
reason: "I am approving this document",
contactInfo: "dpstory@acrotex.net",
appearance: "My Signature"
}
};
\signatureSign
\end{dCmd*}
\egroup
\CmdDescription The \textsf{eforms} package supports the creation of
signature fields. Such fields can be signed using the \textsf{Acrobat} UI,
or programmatically using the \cs{sigInfo} and \cs{signatureSign}
commands. See the eforms manual, \texttt{eformman.pdf} for a detailed
description of the parameters of \cs{sigInfo}.
\settowidth{\aebdimen}{\ttfamily\string\signatureSetSeedValue(oSeedValue)}%
\begin{dCmd}{\aebdimen+2\fboxsep+2\fboxrule}
\signatureSetSeedValue(oSeedValue)
\end{dCmd}
\CmdDescription The \textsf{Acrobat} JavaScript methods
\texttt{\emph{Field}.signature\-Set\-Seed\-Value} is implemented through
the {\LaTeX} comment \cs{signature\-Set\-Seed\-Value}. The method needs
the field object of the signature field, this is passed to
\cs{signature\-Set\-Seed\-Value} through the JavaScript variable
\texttt{oSigFileName}. To use this command, you first get
\texttt{oSigFileName}, like so,
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily reasons: ["This is a reason","This is a better reason"],}%
\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule}
var sv={
mdp: "defaultAndComments"
reasons: ["This is a reason","This is a better reason"],
flags: 8
};
var oSigFileName=this.getField("sigOfDPS");
\signatureSetSeedValue(sv);
\end{dCmd*}
\egroup The above code defines a object, \texttt{sv}, with seed value
properties: the implication of the \texttt{mp} entry, is that the
signature field is now a certification signature, filling in form
fields and making comments do not invalidate the signature; when the
user signs the document, he must choose from the two listed reasons,
and none other; the \texttt{flags} property makes the choice of a
reason a requirement. The next line, following the definition of
\texttt{sv}, we get the field object of the signature field, and
name it \texttt{oSigFileName}, this is the name that
\cs{signatureSetSeedValue} uses. Finally, we pass the \texttt{sv}
object to \cs{signatureSetSeedValue}.
Additional information on signatures can be found
at the \mlhref{http://www.adobe.com/go/acrobat_developer}{Acrobat Developer Center}.\footnote{\url{http://www.adobe.com/go/acrobat_developer}}
The \emph{JavaScript for Acrobat API Reference} \cite{tech:AcroJSRef} for details
on these methods and their parameters.
\subsection{Examples}
\Ex{} Demonstrate \cs{addWatermarkFromFile}: The following code places a
background graphic on every page the document. This is the kind of code
that is executed for this document.
\bgroup\small\obeyspaces%
\settowidth{\aebdimen}{\small\ttfamily cDIPath: "/C/AcroPackages/ManualBGs/Manual\_BG\_DesignV\_AeB.pdf"}%
\begin{dCmd*}[fontsize=\small]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{docassembly}
\addWatermarkFromFile({
bOnTop:false,
cDIPath: "/C/AcroPackages/ManualBGs/Manual_BG_DesignV_AeB.pdf"
});
\end{docassembly}
\end{dCmd*}
\egroup
\Important It is \emph{very important} to note that the arguments for this
(pseudo-JS method) are enclosed in matching parentheses/braces
combination, i.e., \verb!({!$\dots$\verb!})!. The arguments are
key-value pairs separated by a colon, and the parameters themselves
are separated by commas. (The argument is actually an
object-literal). It is \emph{extremely important} to have the left
parenthesis/brace pair, \verb!({!, immediately follow the function
name. This is because the environment is a partial-verbatim
environment: \verb!\! is still the escape, but left and right braces
have been ``sanitized''. The commands, like
\cs{addWatermarkFromFile} first gobble up the next two tokens, and
re-inserts \verb!({! in a different location. (See the
\textsf{aeb\_pro.dtx} for the definitions.)
\Ex{} Demonstrate \cs{getSound}: For another cheesy demonstration,
let's import a sound, associate it with a button. I leave it to you
to press the button at your discretion.
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\setbox0=\hbox{\includegraphics[height=16bp]{../extras/{\AEB}_Logo.eps}}
\pushButton[\S{S}\W{0}\A{\JS{%
var s = this.getSound("StarTrek");\r
s.play();
}}]{cheesySound}{\the\wd0 }{\the\ht0 }
\end{Verbatim}
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\begin{docassembly}
try {
\importSound({cName: "StarTrek", cDIPath: "../extras/trek.wav" });
} catch(e) { console.println(e.toString()) };
\end{docassembly}
\end{Verbatim}
\exPDFSrc{aebpro_ex3} The working version of this appears in
\texttt{aebpro\_ex3}.
\Ex{} Demonstrate \cs{getIcon}: Import a few {\AEB} logos
(forgive me) and place them as appearance faces for a button.
Below is a listing of the code, with some comments added.
\begin{Verbatim}[fontsize=\footnotesize]
\begin{docassembly}
// Import the sounds into the document
\importIcon({cName: "logo",cDIPath: "../extras/{\AEB}_Logo.pdf"});
\importIcon({cName: "logopush",cDIPath: "../extras/{\AEB}_Logo_bw15.pdf"});
\importIcon({cName: "logorollover",cDIPath: "../extras/{\AEB}_Logo_bw50.pdf"});
var f = this.getField("cheesySound"); // get the field object of the button
f.buttonPosition = position.iconOnly; // set it to receive icon appearances
var oIcon = this.getIcon("logo"); // get the "logo" icon
f.buttonSetIcon(oIcon,0); // assign it as the default appearance
oIcon = this.getIcon("logopush"); // get the "logopush" icon
f.buttonSetIcon(oIcon,1); // assign it as the down appearance
oIcon = this.getIcon("logorollover"); // get the "logorollover" icon
f.buttonSetIcon(oIcon,2); // assign it as the rollover appearance
\end{docassembly}
\end{Verbatim}
\exPDFSrc{aebpro_ex3} The working version of this appears in \texttt{aebpro\_ex3}.
\Ex{}\label{importdataobject} Demonstrate \cs{importDataObject}: As a final example of
\texttt{docassembly} usage, rather than using the attachments
options of {\cAEBP}, you can also attach your own files using the
\texttt{docassembly} environment.
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\begin{docassembly}
try {
\importDataObject({
cName: "AeB Pro Example #2",
cDIPath: "aebpro_ex2.pdf"
});
} catch(e){}
\end{docassembly}
\end{Verbatim}
The attachments options automatically assign names. These names appear in
the Description column of the attachments tab of
\textsf{Acrobat}/\textsf{Reader}. For file attached using the
\texttt{attachsource}, the base name plus extension is used, for the files
specified by the \texttt{attachments} key, the names are given
sequentially, \texttt{"{\AEB} Attachment 1"}, \texttt{"{\AEB} Attachment 2"} and
so on. When you roll your own, the description can be more aptly chosen.
On the other hand, there are commands, introduced later, that allow you to
change the default description, to one of your own choosing.
I have found many uses for the \texttt{execJS} environment, or the
simplified \texttt{docassembly} environment. You are only limited by your
imagination, and knowledge of JavaScript for \textsf{Acrobat}.
\subsection{Pre-\texttt{docassembly} Methods}
In this section, we'll gather some ``useful'' commands that may be useful
in combining several \texttt{docassembly} tasks together. The
\texttt{docassembly} environment is a partial-verbatim environment,
expansion is severely limited. The trick is to expand before placing the
lines in the \texttt{docassembly} environment.
\subsubsection{Importing and Placing Images}
In this section we introduce four commands for importing images
(possibly with various graphic formats) into the PDF document, and
inserting them as images that appear in the document itself. These are\\[3pt]
\hspace*{20pt}\Com{declareImageAndPlacement}, \Com{declareMultiImages},\\
\hspace*{20pt}\Com{insertPreDocAssembly}, and \Com{placeImage}.
\exAeBBlogPDF{p=315} The file \texttt{placeimages.pdf} is a
demo of the commands of this section. The source file and images are
attached to the PDF. The PDF, titled \textsl{Importing and Placing
Images using {\AEBP}}, is found at the \href{\urlAcroTeXBlog}{{\AcroTeX} Blog} web site.
\settowidth{\aebdimen}{\ttfamily\string\declareImageAndPlacement\darg{\meta{KV-pairs}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\declareImageAndPlacement{!meta(KV-pairs)}
\end{dCmd}
\CmdDescription This command creates the JavaScript code to import images
(icons) and associates them with target push buttons that are created by
\cs{placeImage}. The images are imported into the document when the
document is first opened in \textsf{Acrobat}. The images themselves can be
PDF, BMP, GIF, JPEG, PCX, PNG, TIFF, or some other supported format. (See
the documentation on the method \texttt{\emph{Doc}.importIcon} for
details.) The file is converted to PDF when imported.
\Important This command is executed in the preamble only, can be executed
more than once, (once for each image being imported), and \emph{outside of
the \texttt{docassembly} environment}.
\KVP This command takes up to four key-value pairs.
\begin{itemize}
\item \texttt{name}: (\emph{Optional}) The symbolic name to be associated with this image. The name
is later used to attach the image to the push button (created by \cs{placeImage}).
If a value for this key is not provided, one will be automatically created.
\item \texttt{path}: (\emph{Required}) The path to the image, this can be a relative path or an absolute
path. If absolute, use the device independent path notation of \textsf{Acrobat}; for example,\\[3pt]
\hspace*{20pt}\texttt{/C/acrotex/myimages/myimage.png}.
\item \texttt{page}: (\emph{Optional}) If the image is a PDF, the PDF may contain several pages,
each with an image on it. You can specify which of the pages to import using
the \texttt{page} key. If no \texttt{page} key is specified, page 0 is assumed.
\item\texttt{placement}: (\emph{Optional}) This is a comma-delimited list of names of push buttons
created by the command \cs{placeImage}. Multiple place images with the same name all get the
image imported into it. If you want several place images with different names,
list these in a comma delimited list, like so
\begin{Verbatim}
placement={image1,image2,image3}.
\end{Verbatim}
If a value for this key is not provided,
a message in the log is generated; the images are imported (embedded) in the document,
are not used to create visible images. Either provide a \texttt{placement} key-value pair,
or learn how to use (named) icons that are embedded in the document with the \texttt{\emph{Doc}.importIcon()}
method.
\end{itemize}
Multiple images can be imported and set by simply executing
\cs{declareImage\-And\-Place\-ment} multiple times with a different set of
arguments, or, by executing \cs{declare\-Multi\-Images}.
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily \darg{\meta{KV-pairs\_1}}\darg{\meta{KV-pairs\_2}}\darg{\meta{KV-pairs\_3}}...\darg{\meta{KV-pairs\_n}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\declareMultiImages
{
{!meta(KV-pairs_1)}{!meta(KV-pairs_2)}{!meta(KV-pairs_3)}...{!meta(KV-pairs_n)}
}
\end{dCmd}
\egroup\CmdDescription This command calls the \cs{declareImageAndPlacement}
command for each of its arguments. The argument of the command is a series of
tokens (enclosed in braces); within each pair of matching braces are
\meta{KV-pairs} of the arguments of \cs{declareImageAndPlacement}. The
command \cs{declareMultiImages} loops through the list, calling
\cs{declareImageAndPlacement} with the current set of \meta{KV-pairs}. An
example follows.
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily \darg{path=graphics/girl.png,placement=\darg{Avatar3,Avatar4}}}%
\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule}
\declareMultiImages
{%
{path=graphics/girl.png,placement={Avatar3,Avatar4}}
{path=graphics/AcroFord.jpg,placement=AcroFord}
{path=graphics/scot.gif,placement=Scot}
}
\end{dCmd*}
\egroup
\Important This command is executed in the preamble only, can be executed more than
once, (once for each image being imported), and \emph{outside of the \texttt{docassembly} environment}.
Once the images have been defined and referenced using any of the above commands,
you need to actually executed the JavaScript code these commands created. This is done
with the \cs{insertPreDocAssembly} inside the \texttt{docassembly} environment.
\settowidth{\aebdimen}{\ttfamily\string\insertPreDocAssembly}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\insertPreDocAssembly
\end{dCmd}
\CmdDescription This command expands to all the JavaScript code
created by the commands \cs{declare\-ImageAndPlacement} and
\cs{declareMultiImages}. It is \emph{placed within the
\texttt{docassembly} environment}, like so
\settowidth{\aebdimen}{\ttfamily\string\insertPreDocAssembly}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{docassembly}
\insertPreDocAssembly
\end{docassembly}
\end{dCmd}
The target buttons are be created by the \cs{pushButton} command from the \texttt{eforms} package,
but as a convenience, {\AEBP} defines the \cs{placeImage} command
\settowidth{\aebdimen}{\ttfamily\string\placeImage[\meta{options}]%
\darg{\meta{name}}\darg{\meta{width}}\darg{\meta{height}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\placeImage[!meta(options)]{!meta(name)}{!meta(width)}{!meta(height)}
\end{dCmd}
\CmdDescription Creates a readonly push button with an icon only appearance.
The \meta{options} can be used to modify the appearance of the button (add a
border, for example); the \meta{name} is used as the field name, and is
referenced in the \texttt{placement} key of \cs{declareImageAndPlacement}.
The \meta{width} and \meta{height} are what they appear to be, the
width and height of the image.
If the width and height is not correct, \textsf{Acrobat} will scale the
image. There are other controls that can be used through the optional
arguments to position the image within its bounding box. The dimensions of
the image you want to use can be acquired through various methods. On
windows, the dimension of the image for PNG and JPG are displace when the
mouse is moved over the image (while using explorer).
\textbf{Note.} At times, I have imported images this way, these commands
just simply the task. This method may be preferred over using
\cs{includegraphics} when the image has transparency that you want to
preserve. For example, if a PNG image has a transparent background, it
will be imported into the document with the transparent background. For
those using \textsf{Adobe Distiller}, the transparency is often lost
(unless the image uses vector graphics) when converting to an EPS file.
\subsubsection{Creating Custom Button Appearances}
The \cs{placeImage} command described in the last section is a \cs{pushButton}
designed to be read only and is meant to be used to place non-interactive
images in the document. The methods of the previous section can also be used
to create custom button appearances using graphics files of various formats.
To this end, an optional parameter is defined for the value(s) of the \texttt{placement}
parameter in \cs{declareImageAndPlacement} and \cs{declareMultiImages}. Each button
has (at most) three appearance states: normal, rollover, and down. The additional
optional parameter allows you to specify what appearance state the icon is to be used for.
The optional parameter is shown in the example below.
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily \darg{path=graphics/girl.png,placement=\darg{[2]Avatar1,[0]Avatar2}}}%
\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule}
\declareMultiImages
{%
{path=graphics/man1.pdf,placement={Avatar1,[2]Avatar2}}
{path=graphics/scot.gif,placement={[1]Avatar1,[1]Avatar2}}
{path=graphics/girl.png,placement={[2]Avatar1,[0]Avatar2}}
}
\end{dCmd*}
\egroup The optional argument precedes the field name and determines the
appearance state of the button the icon is to be used; the values
are \texttt{[0]} (default, normal icon); \texttt{[1]} (down icon);
and \texttt{[2]} (rollover icon). There must be no space between the
optional argument and the field name; if you type \texttt{"[2]
Avatar1"}, for example, the field name is interpreted as \texttt{"
Avatar1"}, which is incorrect.
\exAeBBlogPDF{p=341} Further details and examples may be found in the blog
article \texttt{button\_appr.pdf} titled \emph{Creating Button
Appearances}, found at the \href{\urlAcroTeXBlog}{{\AcroTeX} Blog} web
site. The source file and images are attached to the PDF.
\subsubsection{Methods in support of Button
Anime}\label{sss:btnAnimeMethods}
The commands and methods described in this section are in support for
`\mlnameref{s:btnanime}' on page~\pageref*{s:btnanime}.
The \texttt{btnanime} option brings in the code necessary to create what I
call button anime, as opposed to OCG anime (using layers). Two
pre-docassembly commands were created for this purpose
\cs{embedMultiPageImages} and \cs{placeAnimeCtrlBtnFaces}.
\settowidth{\aebdimen}{\ttfamily\string\embedMultiPageImages\darg{\meta{options}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\embedMultiPageImages{!meta(options)}
\end{dCmd}
\CmdDescription The command embeds (in the document) and optionally places
a series of icons all of which are pages of the same PDF file. This
command does not need the \texttt{btnanime} option, it is part of the core
{\AEB} code.
\KVP There are a number of key-value pairs the argument recognizes.
\begin{itemize}
\item \texttt{path}: The path to the PDF containing the images to be
used. This path can be relative or absolute. This key is required.
\item \texttt{name}: The base name to be associated with the images
being embedded. This key is required.
\item \texttt{placement}: A comma-delimited list, each member of the list is the
base name of the button anime field created by \cs{btnAnime} that is
to use this set of images. This key is optional, if not present, the
images are embedded only.
\item \texttt{firstpage}: The page number (the first page is page 1)
of the first image to be embedded and used. This key is optional;
if \texttt{firstpage} is not specified, its default value is 1.
\item \texttt{lastpage}: The page number (base-1 page numbering) of
the last image to be embedded and used. The value of this key is
required.
\end{itemize}
For example, here we embed the first 41 pages from the file
\texttt{sine\_anime.pdf}, which resides in the subfolder \texttt{graphics},
and associates it with the button anime field \texttt{mysine}.
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily path=graphics/sine\_anime.pdf,placement=mysine\}}%
\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule}
\embedMultiPageImages{lastpage=41,name=sine,
path=graphics/sine_anime.pdf,placement=mysine}
\end{dCmd*}
\egroup
The control buttons for a button anime require a custom appearance.
{\AEBP} supplies one set of custom icons, and allows for the creation
of more by the interested document author, that's you.
\settowidth{\aebdimen}{\ttfamily\string\placeAnimeCtrlBtnFaces[\meta{path}]%
\darg{\anglemeta{appr\_icons}.pdf}\darg{\meta{list\_of\_animes}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\placeAnimeCtrlBtnFaces[!meta(path)]{!anglemeta(appr_icons).pdf}{!meta(list_of_animes)}
\end{dCmd}
\CmdDescription This command associate the icon set to be used for the
button appearances of the buttons used to control the button animation.
(That's a lot of buttons in that last sentence!)
\PD The command takes three parameters, one of which is optional.
\begin{description}
\item[\normalfont\texttt{[\meta{path}]}] is the (optional) path to the button control
appearance icons. If no argument is present,
the value of \cs{pathToBtnCtrlIcons} is used, see \texttt{aebpro.cfg}
for its definition. The icon set distributed with {\AEBP} is named
\texttt{btn\_anime\_icons1.pdf}, and is found in the icons folder of
the \texttt{aeb\_pro} folder.
\item[\normalfont\texttt{\anglemeta{appr\_icons}}] is the name of the PDF file that
contains the icons to be used for the appearances of the control
buttons.
\item[\normalfont\texttt{\meta{list\_of\_animes}}] is a comma-delimited list of the base
names of the anima created by \cs{btnAnima} that will be using these
appearance icons.
\end{description}
\textbf{Example:}
\settowidth{\aebdimen}{\ttfamily\string\placeAnimeCtrlBtnFaces\darg{btn\_anime\_icons1.pdf}\darg{myclock,mysine}}%
\begin{dCmd*}{\aebdimen+2\fboxsep+2\fboxrule}
\placeAnimeCtrlBtnFaces{btn_anime_icons1.pdf}{myclock,mysine}
\end{dCmd*}
The above example uses no optional parameter, so \cs{placeAnimeCtrlBtnFaces} uses the path defined
by \cs{pathToBtnCtrlIcons} in \texttt{aebpro.cfg}. On my personal system,
the \texttt{aebpro.cfg} file reads
\begin{Verbatim}
%
% AeB Pro Configuration file
%
\ExecuteOptionsX{driver=dvips}
\renewcommand{\pathToBtnCtrlIcons}
{C:/Users/Public/Documents/My TeX Files/tex/latex/aeb_pro/icons}
\end{Verbatim}
You should seek out the \texttt{aebpro.cfg} and edit this command to point
to the \texttt{icons} folder of \texttt{aeb\_pro.} You can create your own
icon PDF file in the \texttt{icons} folder; the guidelines for creating
such an icon PDF file are simple. Places the icon from each page as the
appearance of a corresponding control button. The expected order of the
icons is given in \hyperref[fig:apprCntrls]{Figure~\ref*{fig:apprCntrls}},
page~\pageref*{fig:apprCntrls}.
If you put your custom appearance icon set in the source folder, you can
reference like so,
\begin{Verbatim}
\placeAnimeCtrlBtnFaces[.]{btn_anime_custom.pdf}{myclock,mysine}
\end{Verbatim}
The optional \texttt{[.]} overrides the definition of
\cs{pathToBtnCtrlIcons}, and refers to the current folder. If you never
defined \cs{pathToBtnCtrlIcons} (its default definition is empty), then
\begin{Verbatim}
\placeAnimeCtrlBtnFaces{btn_anime_custom.pdf}{myclock,mysine}
\end{Verbatim}
does the trick. If you have them in a subfolder (\texttt{graphics}) of the source file folder,
then
\begin{Verbatim}
\placeAnimeCtrlBtnFaces[graphics]{btn_anime_custom.pdf}{myclock}
\end{Verbatim}
\begin{figure}[htb]\centering
\begin{tabular}{cl}
Page & Icon\\\hline
0 & Go to first frame\\
1 & Go to last frame\\
2 & Step back one frame\\
3 & Step forward one frame\\
4 & Play backward\\
5 & Play forward\\
6 & Pause\\
7 & Increase speed\\
8 & Decrease speed
\end{tabular}
\caption{Icons by page for Button Anime Controls}\label{fig:apprCntrls}
\end{figure}
Finally, because these are pre-docassembly methods, these two commands go
in the preamble, and are followed by the \texttt{docassembly} environment;
like so,\dots
\settowidth{\aebdimen}{\ttfamily\string\placeAnimeCtrlBtnFaces\darg{btn\_anime\_icons1.pdf}\darg{myAnimation,mysine}}%
\begin{dCmd*}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\embedMultiPageImages{lastpage=36,name=rotate,
path=graphics/animation.pdf,placement=myAnimation}
\embedMultiPageImages{lastpage=41,name=sine,
path=graphics/sine_anime.pdf,placement=mysine}
\placeAnimeCtrlBtnFaces{btn_anime_icons1.pdf}{myAnimation,mysine}
\begin{docassembly}
\insertPreDocAssembly;
\executeSave();
\end{docassembly}
\end{dCmd*}
You may have other pre-docassembly commands as well.
\section{Linking to Attachments}\label{linktoattachments}
Should you wish to link to your attachments or \emph{rename their
descriptions}, the \texttt{link\-to\-at\-tach\-ments} option needs to be specified in the
option list of \texttt{aeb\_pro}. This defines many of the commands
discussed in this section enabling you to link to a PDF attachment,
open a PDF or non-PDF attachment, save a PDF or non-PDF
attachment to the local hard drive, or simply to rename the descriptions
of the attachments.
\exPDFSrc{aebpro_ex5} The document \texttt{aebpro\_ex5} has working examples
of the ideas and commands discussed in this section.
\penalty-1000
\subsection{Naming Attachments}
Associated with each embedded file is a name (or label) and a description.
The name given to an attachment (an embedded file) is used by \textsf{Acrobat}
to reference its location within the embedding {\PDF} document. This name (or
label) is used when creating links to the embedded document as well;
consequently, the assigned name is quite important.
\subsubsection{Default Descriptions and Labels}
With {\cAEBP}, \texttt{you} can attach files in three ways: (1) with the \texttt{attachsource} key,
(2) with the attachments key; and (3) using the \cs{importDataObject} method, as
demonstrated in \hyperref[importdataobject]{Example~\ref{importdataobject}}. For attachments
that fall into categories (1) and (2), {\AEB} assigns default labels and descriptions. These
are presented in \hyperref[deflabelnames]{Table~\ref*{deflabelnames}}, page~\pageref*{deflabelnames}.
\begin{table}[ht]\centering
\begin{tabular}{>{\ttfamily}l>{\ttfamily}l>{\ttfamily}l}
attachsource & \textrm{label} & \textrm{description}\\\hline
tex & tex & \cs{jobname.tex}\\
dvi & dvi & \cs{jobname.dvi}\\
log & log & \cs{jobname.log}\\
$\dots$&$\dots$ & $\dots$\\[2ex]
attachments & \textrm{label} & \textrm{description}\\\hline
$1^{\text{st}}$ file & attach1 & {\AEB} Attachment 1\\
$2^{\text{nd}}$ file & attach2 & {\AEB} Attachment 2\\
$3^{\text{rd}}$ file & attach3 & {\AEB} Attachment 3\\
$4^{\text{th}}$ file & attach4 & {\AEB} Attachment 4\\
$\dots$ & $\dots$ & $\dots$
\end{tabular}
\caption{Default label/descriptions}\label{deflabelnames}
\end{table}
For documents attached by \texttt{attachsource}, the default label is the extension,
and the default description is the filename with extension.
For documents attached by the \texttt{attachments} option, {\cAEBP}
assigns them ``names,'' which appear in the attachments tab of
\textsf{Acrobat/Reader} as the Description.\footnote{The Description is
important as it is the way embedded files are referenced internally.} The
names assigned are \texttt{{\AEB} Attachment 1}, \texttt{{\AEB} Attachment 2},
\texttt{{\AEB} Attachment 3}, and so on.
If you embed a file using the \cs{importDataObject} method within the
\texttt{docassembly} environment (see
\hyperref[importdataobject]{Example~\ref{importdataobject}},
page~\pageref*{importdataobject}), you are free to assign a name of your
preference.
\subsubsection{Assigning Labels and Descriptions}\label{assigningLabels}
Whatever method is used to attach a document to the parent document,
the names must be converted to unicode on the {\TeX} side of things
to set up the links, and there must be a \LaTeX-like way of
referencing this unicode name, hence the development of the
\texttt{at\-tach\-ments\-Names} environment and the two commands
\cs{autolabelNum} and \cs{labelName}.\footnote{It is important to
note that these are not needed unless you are linking to the
embedded files.} These two commands, described below, should appear
in the \texttt{attachment\-Names} environment in the preamble.
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily \anglemeta{\string\autolabelNum{} and \string\labelName{} commands}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{attachmentNames}
!anglemeta(\autolabelNum and \labelName commands)
\end{attachmentNames}
\end{dCmd}
\egroup
\EnvLoc The preamble of the document. The \texttt{attachmentNames}
environment and the commands \cs{autolabel\-Num} and \cs{labelName}
should be used only in the parent document; for child documents they
are not necessary.
\Ex{}\label{declarations} Below are the declaration that appear in
the supporting file \texttt{aebpro\_ex5}:
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\begin{attachmentNames}
\autolabelNum{1}
\autolabelNum*{2}{target2.pdf Attachment File}
\autolabelNum*[AeST]{3}{{\AEB}ST Components}
\labelName{cooltarget}{My (cool) $|x^3|$ ~ % '<attachment>'}
\end{attachmentNames}
\end{Verbatim}
Descriptions of these commands follow.
\settowidth{\aebdimen}{\ttfamily\string\autolabelNum[\meta{label}]\darg{\anglemeta{num}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\autolabelNum[!meta(label)]{!anglemeta(num)}
\end{dCmd}
\CmdDescription For PDFs (or other files) embedded using the
\texttt{attachments} option, use the \cs{autolabelNum} command.
\PD The first optional argument is the label to be used to refer to this
embedded file; the default is \anglemeta{num}. The second
argument is the second is a number, \anglemeta{num}, which
corresponds to the order the file is listed in the value of the
\texttt{attachments} key.\footnote{To minimize the number of changes
to the document, if you later add an attachment, add it to the end
of the list so the earlier declarations are still valid.}
\newtopic There is a star form of \cs{autolabelNum}, which
allows to change the description of the attachment.
\settowidth{\aebdimen}{\ttfamily\string\autolabelNum*[\meta{label}]\darg{\anglemeta{num}}\darg{\anglemeta{description}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\autolabelNum*[!meta(label)]{!anglemeta(num)}{!anglemeta(description)}
\end{dCmd}
\CmdDescription Each file listed as a value in the \texttt{attachments} key
has a number, \anglemeta{num}, assigned to it according to the order it
appears in the list, and a default description
of `\texttt{{\AEB} Attachment \anglemeta{num}}'. This command
allows you not only to change the label, but to change the
description of the attachment as well.
\PD The first optional argument is the label to be used to refer to this
embedded file; the default is \texttt{attach\anglemeta{num}}. The second
argument is the second is a number, \anglemeta{num}. The third parameter,
\anglemeta{description}, is the description that will appear in the
attachments pane of \textsf{Acrobat/Reader}.
\newtopic For files that are embedded using
\cs{importDataObject}, use the command \cs{labelName} for assigning
the name, and setting up the correspondence between the name and the
label.
\settowidth{\aebdimen}{\ttfamily\string\labelName\darg{\meta{label}}\darg{\anglemeta{description}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\labelName{!meta(label)}{!anglemeta(description)}
\end{dCmd}
\PD The first argument is the label to be used to reference this embedded
file. The second parameter, \anglemeta{description}, you can assign an
arbitrary name used for the description.
\subsubsection{Notes on the
\texorpdfstring{\protect\anglemeta{description}}{<description>} parameter}\label{description}
The \anglemeta{description} parameter used in \cs{autolabelNum*} and
\cs{labelName} can be an arbitrary string assigned to the description of this
embedded file, the characters can be most anything in the Basic Latin unicode
set, 0021--007E, with the exception of left and right braces \verb!{}!,
backslash \verb!\! and double quotes \texttt{"}.
%If you take the \texttt{latin1} option, the unicodes for 00A1--00FF are also included.
A unicode character code can also be entered directly into the
description by typing \cs{uXXXX}, where \texttt{XXXX} are
four hex digits. (Did I say not to use `\verb!\!'?) This is very
useful when using the trouble making characters such as backslash,
left and right braces, and double quotes, or using unicode above
00FF (Basic Latin + Latin-1). To illustrate, suppose we wish the
description of \texttt{cooltarget} to be
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
"$|e^{\ln(17)}|$"
\end{Verbatim}
All the bad characters!
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\labelName{cooltarget}{\u0022$|e^\u007B\u005Cln(17)\u007D|$\u0022}
\end{Verbatim}
From the unicode character tables we see that
\begingroup\parskip0pt
\begin{itemize}
\item left brace \cs{u007B}
\item right brace \cs{u007D}
\item backslash \cs{u005C}
\item double quotes \cs{u0022}
\end{itemize}
\par\endgroup
\exPDFSrc{aebpro_ex6} See the example file \texttt{aebpro\_ex6.tex}
for additional examples of the use of \cs{uXXXX} character codes.
There are several ``helper'' commands as well: \cs{EURO},
\cs{DQUOTE}, \cs{BSLASH}, \cs{LBRACE} and \cs{RBRACE}. When the
\cs{u} is detected, an \cs{expandafter} is executed. This allows a
command to appear immediately after the \cs{u}, things work out well
if the command expands to four hex numbers, as it should. Thus,
instead of typing \cs{u0022} you can type \verb!\u\DQUOTE!.
\subsection{Linking to Embedded Files}\label{embed}
This package defines two commands, \cs{ahyperref} and
\cs{ahyperlink}, to create links between parent and child and child
and child. The default behavior of \cs{ahyperref} (and
\cs{ahyperlink}) is to set up a link from parent to child.
\cs{ahyperlink} and \cs{ahyperref} are identical in all respects
except for how it interprets the destination. (Refer to
\mlNameref{jump} for details.)
\newtopic The commands each take three arguments, the
first one of which is optional
\settowidth{\aebdimen}{\ttfamily\string\ahyperlink[\meta{options}]%
\darg{\meta{target\_label}}\darg{\meta{text}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\ahyperref[!meta(options)]{!meta(target_label)}{!meta(text)}
\ahyperlink[!meta(options)]{!meta(target_label)}{!meta(text)}
\end{dCmd}
\CmdDescription \cs{ahyperref} is used to jump to a destination (as
specified by the \texttt{dest} key, listed in
\hyperref[aKeyVal]{Table~\ref*{aKeyVal}}, page~\pageref*{aKeyVal})
defined by the \cs{label} command, whereas \cs{ahyperlink} is used
to jump to a destination (as specified by the \texttt{dest} key)
defined by the \cs{hypertarget} of \textsf{hyperref}. See
\hyperref[jump]{Section~\ref*{jump}}, page~\pageref*{jump} for details.
\PD The commands each take three arguments, the first one of which
is optional.
\begingroup\parskip0pt
\begin{aebDescript}
\item [\meta{options}] are the options for modifying the appearance of
the link, and for specifying the relationship between the source and
the target file. These are key-value pairs documented
in \hyperref[aKeyVal]{Table~\ref*{aKeyVal}}, page~\pageref*{aKeyVal}.
\item \meta{target\_label} is the label of the target file, the label is
the default label, if there is one, or as defined by
\cs{autolabelNum} or \cs{labelName}.
\item [\meta{text}] is the text that is highlighted for this link.
\end{aebDescript}
\par\endgroup
\begin{table}[ht]\centering\small
\begin{tabular}{|>{\ttfamily}l|>{\ttfamily\raggedright}p{1.3in}|p{2.5in}|}\hline
\textbf{Key} &\textbf{Value}&\textbf{Description}\\\hline
goto &p2c, c2p, c2c & The type of jump, parent to child, child to parent, and child to
child. The default is \texttt{p2c}.\\[1ex]
page &\anglemeta{number}& The page of the embedded document to jump to. Default is \texttt{0}.\\[1ex]
view &\anglemeta{value} & The view to be used for the jump. Default is \texttt{Fit}.\\[1ex]
dest &\anglemeta{string}& Jump to a named destination. When this key has a value, the values
of the keys \texttt{page} and \texttt{view} are ignored.\\[1ex]
open &usepref, new, existing
& Open the attachment according to the user preferences,
a new window, or the existing window. The default is \texttt{userpref}.\\[1ex]
border &visible, invisible
& Determines whether a visible rectangle appears around the
link. The default is \texttt{in\-vis\-i\-ble}.\\[1ex]
highlight &none, invert, outline, insert
& How the viewer highlights the link when the
link is clicked. The default is \texttt{invert}.\\[1ex]
bordercolor &r g b & The color of the border when it is visible. The default is black.\\[1ex]
linestyle &solid, dashed, underlined
& The line style of the border when it is visible.
The default is \texttt{solid}.\\[1ex]
linewidth &thin, medium, thick
& The line width when the border is visible. When invisible,
this is set to a width of zero. The default is \texttt{thin}.\\[1ex]
preset &\anglemeta{\cs{presetCommand}}
& A convenience key. You can define some preset values.\\\hline
\end{tabular}
\caption{Key-value pairs for links to embedded files}\label{aKeyVal}
\end{table}
\Ex{} We assume the declarations as given in \hyperref[declarations]{Example~\ref*{declarations}},
page~\pageref*{declarations}. In the simplest case, we jump from the parent to the first page of a
child file given by$\dots$
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\ahyperref{attach1}{target1.pdf}
\end{Verbatim}
This is the same as
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\ahyperref[goto=p2c]{attach1}{target1.pdf}
\end{Verbatim}
The \texttt{goto} key is one of the key-value pairs taken by the
optional argument. Permissible values for the \texttt{goto} key are
\texttt{p2c} (the default), \texttt{c2p} (child to parent) and
\texttt{c2c} (child to child).
\Ex{} We assume the declarations as given in \hyperref[declarations]{Example~\ref*{declarations}},
page~\pageref*{declarations}. Similarly, link to the other embedded files in this parent:
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\ahyperref{attach2}{target2.pdf}
\ahyperref{cooltarget}{aebpro\_ex2.pdf}
\end{Verbatim}
In all cases above, the \cs{ahyperlink} command could have been
used, because no \emph{named} destination was specified, without a
named destination, the these links jump to page~1.
\subsection{Jumping to a target}\label{jump}
As you may know, {\LaTeX}, more exactly, \texttt{hyperref} has two
methods of jumping to a target in another document, jump to a label
(defined by \cs{label}) and jump to a target set by
\cs{hypertarget}. Each of these is demonstrated for embedded files
in the next two sections.
\exPDFSrc{aebpro_ex5} The document \texttt{aebpro\_ex5} has working examples
of the ideas and commands discussed in this section.
\subsubsection{Jumping to a \texorpdfstring{\protect\cs{hypertarget}}{\textbackslash hypertarget}
with \texorpdfstring{\protect\cs{ahyperlink}}{\textbackslash ahyperlink}}
Suppose there is a destination, with a label of \texttt{mytarget}, defined
by the \cs{hypertarget} command in \texttt{target1.pdf}. To jump to
that destination we would use the following code:
\begin{Verbatim}[xleftmargin=\amtIndent]
\ahyperlink[dest=mytarget]{attach1}{Jump!}
\end{Verbatim}
Note that \texttt{dest=mytarget}, where \texttt{mytarget} is the
label assigned by the \cs{hypertarget} command in \texttt{target1.pdf}.
\penalty-5000
\subsubsection{Jumping to a \texorpdfstring{\protect\cs{label}}{\textbackslash label}
with \texorpdfstring{\protect\cs{ahyperref}}{\textbackslash ahyperref}}
{\LaTeX} has a cross-referencing system, to jump to a target set by
the \cs{label} command we use the \textsf{xr-hyper} package that
comes with \texttt{hyperref}; the code might be
\begin{Verbatim}[xleftmargin=\amtIndent]
\ahyperref[dest=target1-s:intro]{attach1}
{Section~\ref*{target1-s:intro}}
\end{Verbatim}
we set \verb!dest=target1-s:intro!.
The label in \texttt{target1.pdf} is \texttt{s:intro}, in the preamble of
this document we have
\begin{Verbatim}[xleftmargin=\amtIndent]
\externaldocument[target1-]{children/target1}
\end{Verbatim}
\noindent which causes \textsf{xr-hyper} to append a prefix to the label (this
avoids the possibility of duplication of labels, over multiple
embedded files).
\subsection{Optional Args of \texorpdfstring{\protect\cs{ahyperref}}{\textbackslash ahyperref}
and \texorpdfstring{\protect\cs{ahyperlink}}{\textbackslash ahpyerlink}}
The \cs{ahyperref} commands has a large number of optional arguments, see
\hyperref[aKeyVal]{Table~\ref*{aKeyVal}}, page~\pageref*{aKeyVal},
enabling you to create any link that the user interface of \textsf{Acrobat
Pro} can create, and more. These are documented in \textsf{aeb\_pro.dtx}
and well as the main documentation. Suffice it to have an example or two.
By using the optional parameters, you can create any link the UI can create, for example,
\begin{Verbatim}[xleftmargin=\amtIndent]
\ahyperref[%
dest=target1-s:intro,
bordercolor={0 1 0},
highlight=outline,
border=visible,
linestyle=dashed
]{attach1}{Jump!}
\end{Verbatim}
\noindent Now what do you think of that?
\newtopic The argument list can be quite long, as shown above. If you have some favorite settings, you can
save them in a macro, like so,
\begin{Verbatim}[xleftmargin=\amtIndent]
\def\preseti{bordercolor={0 0 1},highlight=outline,open=new,%
border=visible,linestyle=dashed}
\end{Verbatim}
Then, we can say more simply, %\ahyperref[dest=target1-s:intro,preset=\preseti]{attach1}{Jump!}
This link is given by$\dots$
\begin{Verbatim}[xleftmargin=\amtIndent]
\ahyperref[dest=target1-s:intro,preset=\preseti]{attach1}{Jump!}
\end{Verbatim}
\noindent I've defined a \texttt{preset} key so you can predefine
some common settings you like to use, the enter these settings
through preset key, like so \verb!preset=\preseti!. Cool.
Note that in the second example, \texttt{open=new} is included. This
causes the embedded file to open in a new window. For
\textsf{Acrobat/Reader} operating in MDI, a new child window will open;
for SDI (version~8), and if the user preferences allows it, it will open
in its \textsf{Acrobat/Adobe Reader} window.
\subsection{Opening and Saving with \texorpdfstring{\protect\cs{ahyperextract}}
{\textbackslash ahyperextract}}
In addition to embedding and linking a PDF, you can embed most any
file and programmatically (or through the UI) open and/or save it to
the local file system.
To attach a file to the parent PDF, you can use the
\texttt{attachsource} or the \texttt{attachments} options of
{\cAEBP}, or you can embed your own using the
\texttt{importDataObject} method, as described earlier in this file.
If an embedded file is a PDF, you can link to it using \cs{ahyperref} or
\cs{ahyperlink}; we can jump to an embedded PDF and jump back. If the
embedded file is not a PDF, then jumping to it makes no sense; the best we
can do is to open the file (using an application to display the file) and/or
save it to the local hard drive.
The {\cAEBP} package has the command \cs{ahyperextract} to extract
the embedded file, and to save it to the local hard drive, with an
option to start the associated application and to display the file.
The syntax for \cs{ahyperextract} is the same as that of the other
two commands:
\settowidth{\aebdimen}{\ttfamily\string\ahyperextract[\meta{options}]%
\darg{\meta{target\_label}}\darg{\meta{text}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\ahyperextract[!meta(options)]{!meta(target_label)}{!meta(text)}
\end{dCmd}
\PD The \meta{options} are the same as those for \cs{ahyperref} (refer to
\hyperref[aKeyVal]{Table~\ref*{aKeyVal}}, page~\pageref*{aKeyVal}), the
\meta{target\_label} is the one associated with the attachment name,
and the \meta{text} is the link text.
In addition to the standard options of \cs{ahyperref},
\cs{ahyperextract} recognizes one additional key, \texttt{launch}.
This key accepts three values: \texttt{save} (the default),
\texttt{view} and \texttt{viewnosave}. The following is a partial
verbatim listing of the descriptions given in the \textsl{JavaScript
for Acrobat API Reference}, in the section describing
\texttt{importDataObject} method of the Doc object:
\begin{enumerate}
\item \texttt{save}: The file will not be launched after it is
saved. The user is prompted for a save path.
\item \texttt{view}: The file will be saved and then launched.
Launching will prompt the user with a security alert warning if
the file is not a PDF file. The user will be prompted for a save
path.
\item \texttt{viewnosave}: The file will be saved and then
launched. Launching will prompt the user with a security alert
warning if the file is not a PDF file. A temporary path is
used, and the user will not be prompted for a save path. The
temporary file that is created will be deleted by
\textsf{Acrobat} upon application shutdown.
\end{enumerate}
\Ex{} Here is a series of examples of usage:
\begin{enumerate}
\item Launch and view this PDF. The code is\makeatletter\@listdepth=0\relax\makeatother
\begin{Verbatim}[xleftmargin=\amtIndent]
\ahyperextract[launch=view]{cooltarget}{aebpro\_ex3.pdf}
\end{Verbatim}
When you extract (or open) PDF in this way, any links created by
\cs{ahyperref} or \cs{ahyper\-link} will not work since the PDF being
viewed is no longer an embedded file of the parent.
\item View the a file, but do not save. The code is\makeatletter\@listdepth=0\relax\makeatother
\begin{Verbatim}[xleftmargin=\amtIndent]
\ahyperextract[launch=viewnosave]{tex}{aebpro\_ex5.tex}
\end{Verbatim}
Note that for attachments brought in by the \texttt{attachsource} option,
the label for that attachment is the file extension, in this case
\texttt{tex}.
\item Save a file without viewing.\makeatletter\@listdepth=0\relax\makeatother
\begin{Verbatim}[xleftmargin=\amtIndent]
\ahyperextract[launch=save]{AeST}{{\AEB}ST Component List}
\end{Verbatim}
\end{enumerate}
\subsection{The child document}\label{childof}
If one of the documents to be attached is a PDF document created from
a {\LaTeX} source using {\cAEBP}, and you want link back to either the
parent document or another child document, then use the \texttt{childof}
option in the \texttt{aeb\_pro} option list. The value of this key
is the path back to the base name of the parent document. For example,
a child document might specify \verb!childof={../aebpro_ex5}!.
\exPDFSrc{aebpro_ex5} See the support documents
\texttt{aebpro\_ex5}, the parent document and its two child
documents \texttt{children/target1} and \texttt{children/target2},
found in the examples folder.
\section{Creating a PDF Package}
% 8.2.4 p. PDF 1.7 (v8)) 588 collection (portable collection, PDF collection), PDF package, PDF portfolio
The concept of a PDF Package is introduced in \textsf{Acrobat}~8. On first
blush, it is nothing more than a fancy user interface to display embedded
files; however, it is also used in the new email form data workflow.
Using the new \textsf{Forms} menu, data contained in FDF files can be
packaged, and summary data can be displayed in the user interface.
Consequently, the way forms uses it, a PDF package can be used as a simple
database.
Unfortunately, at this time, the form feature/database feature of
PDF Packages is inaccessible to the JavaScript API and {\cAEBP}.
What {\cAEBP} provides is packaging of the embedded files with the
nice UI.
\exPDFSrc{aebpro_ex6} The document \texttt{aebpro\_ex6} provides a working
example of a PDF Package.
\newtopic To create a PDF Package, embed all files in the
parent and use the command \cs{make\-PDF\-Pack\-age} in the preamble to
package the attachments.
\settowidth{\aebdimen}{\ttfamily\string\makePDFPackage\darg{\meta{KV-pairs}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\makePDFPackage{!meta(KV-pairs)}
\end{dCmd}
\KVP There are only two sets of key-value pairs
\begin{aebDescript}
\item [\texttt{initview=\anglemeta{label}}] Specifying a value for the
\texttt{initview} key determines which file will be used as the initial
view when the document is opened. If, for example, \texttt{initview=attach2},
the file corresponding to the label
\texttt{attach2}, as set up in the \texttt{at\-tach\-ment\-Names}
environment is the initial view. Listing \texttt{initview} with
no value (or if \texttt{initview} is not listed at all) causes
the parent document to be initially shown.
\item [\texttt{viewmode=\anglemeta{\upshape details|tile|hidden}}] The
\texttt{viewmode} determines which of three user interfaces
is to be used initially. In terms of the UI terminology:
\begin{align*}
&\texttt{details} = \textsf{View top}\\
&\texttt{tile} = \textsf{View left}\\
&\texttt{hidden} = \textsf{Minimize view}
\end{align*}
The default is \texttt{details}.
\end{aebDescript}
If you use this command with an empty argument list,
\verb!\makePDFPackage{}!, you create a PDF package with the
defaults.
\newtopic\textbf{\textcolor{red}{TIP:}} Use the \cs{autolabelNum*}
command to assign more informative descriptions to the attachments,
like so.
\begin{Verbatim}[xleftmargin=\amtIndent]
\autolabelNum*{1}{European Currency \u20AC}
\autolabelNum*{2}{\u0022$|e^\u007B\u005Cln(17)\u007D|$\u0022}
\autolabelNum*[AeST]{3}{The {\AEB}ST Components}
\autolabelNum*[atease]{4}{The @EASE Control Panel}
\end{Verbatim}
\newtopic\textbf{\textcolor{red}{Warning:}} There seems to be a bug
when you email a PDF Package. When the initial view is \emph{not a
PDF document}, the PDF Package is corrupted when set by email and
cannot be opened by the recipient. When emailing a PDF Package, as
produced by {\cAEBP}, always have the initial view as a PDF document.
\section{Initializing a Text Field with Unicode}
One of the side benefits of the work on linking to attachments of a
PDF document is that the techniques are now in place to be able to initialize
a text field using unicode characters.
The technique uses a combination of a recently introduced command \Com{labelName}
and a new command \Com{unicodeStr}.
\settowidth{\aebdimen}{\ttfamily\string\labelName\darg{\meta{label}}\darg{\meta{string}}}%
\begin{dCmd}[commandchars={!@^}]{\aebdimen+2\fboxsep+2\fboxrule}
\labelName{!meta@label^}{!meta@string^}
\defUniStr{!meta@label^}{!meta@string^}
\unicodeStr(!meta@label^)
\end{dCmd}
\PD The parameter \meta{label} is a {\LaTeX}-type of label name, and \meta{string}
is a combination of ASCII characters and unicodes \cs{uXXXX}, as described earlier
(Review the discussion in \Nameref{assigningLabels}).
\CmdDescription The command \cs{unicodeStr} takes its argument, which is \emph{delimited by
parentheses}, looks up the string referenced by \meta{label} and converts the string
to unicode. The unicode tables that come with {\cAEBP} are used to look up any ASCII
characters; for characters that are available on a standard keyboard, unicode escape
sequences can be used. This is illustrated below.
For example, we first define a unicode string, and reference it using a label.
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\labelName{myCoolIV}{\u0022\u20AC|e^\u007B\u005Cln(17)\u007D|$\u0022}
\end{Verbatim}
Note that the use of \cs{labelName} \emph{should not occur} within the \texttt{{attachmentNames}}
environment, this is for linking to attachments. Here, \cs{labelName} can be used anywhere
before the creation of the text field.
Then we can define a text field with this value as its initial value
and its default value like so,\labelName{myCoolIV}{\u0022\u20AC|e^\u007B\u005Cln(17)\u007D|$\u0022}
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\textField[\textSize{10}\textFont{MyriadPro-Regular}
\DV{\unicodeStr(myCoolIV)}\V{\unicodeStr(myCoolIV)}
]{myCoolIV}{1.5in}{12bp}
\end{Verbatim}
The result is the field
\textField[\textSize{10}\textFont{MyriadPro-Regular}
\DV{\unicodeStr(myCoolIV)}\V{\unicodeStr(myCoolIV)}]{myCoolIV}{1.5in}{12bp}
\pushButton[\textSize{10}\textFont{MyriadPro-Regular}\CA{Reset}\A{\JS{this.resetForm(["myCoolIV"])}}]{reset}{}{12bp}
For version~2.9 of \pkg{aeb\_pro}, the package \pkg{forms16be} is included
when the option \opt{linktoattachments} is specified. The package gives
support to initializing form fields, as just described. In that package,
\cs{defUniStr} is defined and may be used instead of \cs{labelName}. See the
documentation and sample files of \pkg{forms16be} for more information on the
topic of initializing fields using unicode.
\exPDFSrc{aebpro_ex8} The support document \texttt{aebpro\_ex8} is a short tutorial
on these topics, including additional examples on creating a button and combo box that
use unicode encoded strings.
\section{Using Layers, Rollovers and Animation.}\label{layers}
When the \texttt{uselayers} option is taken, the necessary code is
input to produce layers (Optional Content Groups). The
\textcolor{blue}{{\AcroTeX} Presentation Bundle} (APB), which has a
very sophisticated method of control over layers, by comparison, the
\textcolor{blue}{{\cAEBP}} layer support is very primitive indeed. As
a rule, after you create a layer, you will need a control of that
layer. This could be a button or a link that executes JavaScript.
\settowidth{\aebdimen}{\ttfamily\string\xBld[true|false|print=\anglemeta{\upshape{true|false}}]%
\darg{\meta{layer\_name}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\xBld[true|false|print=!anglemeta(!upshape(true|false))]{!meta(layer_name)}
!anglemeta(content of layer)
\eBld
\end{dCmd}
\CmdDescription The basic command for creating a layer is \cs{xBld}.
The content of the layer is set off by the \cs{xBld}/\cs{eBld} pair.
\PD The command \cs{xBld} takes two parameters: (1) the first is
optional, \texttt{true} if the layer is initially visible or
\texttt{false}, the default, if the layer is hidden initially; (2)
the name of the layer, this is used to reference the layer, to make
it visible or hidden. The \texttt{print} key sets the printing attribute
of the of the layer:
\begin{itemize}
\item\texttt{print=true} (or just \texttt{print}): the layer
\emph{always prints}, no matter if it is visible or not.
\item\texttt{print=false}: the layer \emph{never prints}, no matter if it is visible or not.
\item If the print key does appear in the list of optional parameters,
the layer will print if visible, otherwise, it does not print. Normally, the \texttt{print}
key is not specified, and the layer is printed only if visible.
\end{itemize}
A link can be made visible or hidden by getting its OCG object and setting
the \texttt{state} property. A simple example of this would be$\dots$
\begin{Verbatim}[xleftmargin=\amtIndent]
\setLinkText[%
\A{\JS{%
var oLayer = getxBld("mythoughts");
if ( oLayer != null )
oLayer.state = !oLayer.state;
}}
]{\textcolor{red}{Click here}}
\end{Verbatim}
The link text has a JavaScript action. First we get the OCG object
for this layer by calling the \texttt{getxBld} function (this is
part of the {\cAEBP} JavaScript) then if non-null (you may not have
spelled the name correctly) we toggle the current state,
\texttt{oLayer.state = !oLayer.state}.
This is such a common action that a formal JavaScript function is
defined by {\cAEBP}
\begin{Verbatim}[xleftmargin=\amtIndent]
\setLinkText[%
\A{\JS{toggleSetThisLayer("mythoughts");}}
]{\textcolor{red}{Click here}}
\end{Verbatim}
The above examples uses a link, but a form field action can also be used.
\newtopic An advantage of the layers approach is that the content of the
layers are latexed as part of the content of the tex file; consequently,
you can include virtually anything in your layer that tex can handle,
math, figures, PSTricks, etc. \textsf{Acrobat Pro}~7.0 (and
\textsf{Distiller}) or later is required to build the layers, but only
\textsf{Adobe Reader~7.0} or later is needed to view the document, once
constructed.
\exAeBBlogPDF{p=326} The file \texttt{xbld\_options.pdf} is a
demo of the optional parameters for \cs{xBld} of this section. The
source file and images are attached to the PDF. The PDF, titled
\textsl{Exploring the options of \cs{xBld}}, is found at the
\href{\urlAcroTeXBlog}{{\AcroTeX} Blog} web site.
\subsection{Rollovers}
The {\cAEBP} package offers you two rollovers, which ostensibly
provides help to the document consumer.
\exPDFSrc{aebpro_ex4} These topics are illustrated in the support
file \texttt{aebpro\_ex4}.
\exAeBBlogPDF{tag=rollovers} Additional examples of \emph{rollover animation} using \cs{texHelp} can be found
at the \mlhref{\urlAcroTeXBlog}{{\AcroTeX} Blog} web site.
%See also \url{http://www.acrotex.net/blog/?p=1359}
%and \url{http://www.acrotex.net/blog/?p=1363}
%\url{http://www.acrotex.net/blog/?tag=rollovers}
\subsection{Using the form field tool tip feature}
The \cs{texHelp} is a command for creating a rollover for some text.
When the user rolls over the text, a defined layer is made visible
with helpful information. See \texttt{aebpro\_ex4} for working
examples and extensive details.
\subsection{Layers and Animation}
Let's see if we can conjure up a little animation, shall we?
\exPDFSrc{aebpro_ex4} A working version of this example appears in \texttt{aebpro\_ex4}.
\Ex{} This examples create a sine graph using PSTricks. When the start button is pressed,
the function will be graphed in an animated sort of way.
\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small]
\begin{minipage}{.65\linewidth}\centering
\DeclareAnime{sinegraph}{10}{40}
\def\thisframe{\animeBld\psplot[linecolor=red]{0}{\xi}{sin(x)}\eBld}
\psset{llx =-12pt,lly=-12pt,urx =12pt,ury =12pt}
\begin{psgraph*}[arrows=->](0,0)(-.5,-1.5)(6.5,1.5){164pt}{70pt}
\psset{algebraic=true}%
\rput(4,1){$y=\sin(x)$}
\FPdiv{\myDelta}{\psPiTwo}{\nFrames}%
\def\xi{0}%
\multido{\i=1+1}{\nFrames}{\FPadd{\xi}{\xi}{\myDelta}\thisframe}
\end{psgraph*}
\end{minipage}\hfill
\begin{minipage}{.3\linewidth}
\backAnimeBtn{24bp}{12bp}\kern1bp\clearAnimeBtn{24bp}{12bp}\kern1bp
\forwardAnimeBtn{24bp}{12bp}
\end{minipage}
\end{Verbatim}
You will have to delve through the working version of this example in \texttt{aebpro\_ex4}
to fully understand it.
\settowidth{\aebdimen}{\ttfamily\string\DeclareAnime\darg{\meta{basename}}\darg{\meta{speed}}\darg{\meta{nframes}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\DeclareAnime{!meta(basename)}{!meta(speed)}{!meta(nframes)}
\end{dCmd}
This sets the basic parameters of an anime: the base name for the animation, the speed of the animation
as measured in milliseconds, and the number of frames to appear in the anime.
\settowidth{\aebdimen}{\ttfamily\string\animeBld\anglemeta{frame\_content}\string\eBld}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\animeBld!anglemeta(frame_content)\eBld
\end{dCmd}
This \cs{animeBld}/\cs{eBld} pair enclose the ``i$^\text{th}$'' frame.
\settowidth{\aebdimen}{\ttfamily\string\forwardAnimeBtn[\meta{opts}]\darg{\meta{width}}\darg{\meta{height}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\backAnimeBtn[!meta(opts)]{!meta(width)}{!meta(height)}
\clearAnimeBtn[!meta(opts)]{!meta(width)}{!meta(height)}
\forwardAnimeBtn[!meta(opts)]{!meta(width)}{!meta(height)}
\end{dCmd}
These are basic button controls for the anime: back, stop/clear, and forward. Each of these has an
optional parameter where you can modify the appearance of the button. See the eforms manual for details of
these optional parameters.
\section{Button and Ocg Anime}\label{s:btnanime}
In this section. we introduce some commands and one environment for
creating button and OCG anime (see page~\pageref*{ss:ocganime}).
\subsection{The \texorpdfstring{\protect\cs{btnAnime}}{\CMD{btnAinme}} Command}\label{ss:btnanime}
When animating with layers, we create a series of frames in different
layers, and we animate by successively making visible then hiding each of the
layers in turn. The same can be done with buttons. Buttons can take on
appearances using what I'll call icons. We create a series of stacked
buttons, each with an icon appearance; when the animation is started, each
button becomes visible and hidden in turn.
\exAeBBlogPDF{p=382} The demo file for the material in this section,
(and for the support material in `\mlnameref{sss:btnAnimeMethods}' on
page~\pageref*{sss:btnAnimeMethods}) is titled \textsl{\cs{btnAnime}:
Animation using Form Field Buttons with {\AEBP}} can be found at the
\href{\urlAcroTeXBlog}{{\AcroTeX} Blog} web site.
To create a button anima, follow these steps:
\begin{enumerate}
\item Create your animation by placing one frame of your animation on
one page of a PDF. If the anime has 40 frames, the PDF has 40 pages,
each page contains one frame. The anime must be placed on the page
exactly in the same place to avoid any noticeable shaking or trembling
of the anime as it plays. (I use PSTricks to create a few of the demo
animations.) Give your animation PDF some name, say, \texttt{myAnime.pdf}
\item In the preamble, place the following commands
\begin{Verbatim}[xleftmargin=\amtIndent]
\embedMultiPageImages{lastpage=36,name=myAnime,
path=graphics/myAnime.pdf,placement=myFirstAnime}
\placeAnimeCtrlBtnFaces{btn_anime_icons1.pdf}{myFirstAnime}
\begin{docassembly}
\insertPreDocAssembly;
\executeSave();
\end{docassembly}
\end{Verbatim}
The commands \cs{embedMultiPageImages} and \cs{placeAnimeCtrlBtnFaces} are
described in detail in \Nameref{sss:btnAnimeMethods}. These commands embed
the icons (or graphic images) in the PDF document, and associates them with
the anime being created.
\item Use the \cs{btnAnime} command to create your animation.
\cs{btnAnime} is described below, for now, we present an example.
\begin{Verbatim}[xleftmargin=\amtIndent]
\btnAnime{%
fieldName=myFirstAnime,iconName=myAnime,nFrames=36,
controls=skin3,nospeedcontrol,type=loop,
autorun,autopause
}{72bp}{72bp}
\end{Verbatim}
\end{enumerate}
The centerpiece of button anime is the \cs{btnAnime} command, which is the
one that actually creates the button fields to display the animation, and
the button to control the anime.
\settowidth{\aebdimen}{\ttfamily\string\btnAnime\darg{\meta{KV-pairs}}\darg{\meta{width}}\darg{\meta{height}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\btnAnime{!meta(KV-pairs)}{!meta(width)}{!meta(height)}
\end{dCmd}
\CmdDescription Create a series of stacked buttons that hold and display
the frames of the animation; it also creates the control buttons.
\PD The first parameter,\footnote{In version~1.1 (dated 07/10/10) the
first parameter was optional, since there are required keys in this
parameter, I've changed this first parameter to required.} taking
key-value pairs, is describe below, the \meta{width} and
\meta{height} parameters are the width and height of the button fields
to display the animation. These buttons are all the same size and stacked
one on top the other.
\KVP The first optional parameter takes key-value pairs (\meta{KV-pairs}).
\begin{itemize}
\item \texttt{fieldName}: The base name of the anime fields to be
created. The key \texttt{fieldName} corresponds to the
\texttt{placement} key of \cs{embedMultiPageImages}.
\item \texttt{iconName}: The base name of the icon set to be used in
this anime. The \texttt{iconName} key corresponds to the \texttt{name} key
of \cs{embedMultiPageImages}.
\item \texttt{nFrames}: The number of frames in this anime; must be
the same number as \texttt{lastpage-firstpage+1} as declared in
\cs{embedMultiPageImages}. (If the \texttt{first\-page} key is not used, then
\texttt{nFrames=lastpage}.)
\item \texttt{type}: This is a choice key that takes any of three values: \texttt{loop},
\texttt{palindrome}, or \texttt{stopatboundary}. The latter being the
default. For \texttt{loop}, the goes through the stack of frames from
1 to \texttt{nFrames}, then repeats 1 to \texttt{nFrames}, and so on
until the anime is paused. For \texttt{palindrome}, the anime plays in
the order 1 to \texttt{nFrames}, \texttt{nFrames}-1 to 1, then
repeat. This anime continues until the paused. For
\texttt{stopatboundary}, the anima pauses when the frame reaches
\texttt{nFrames} for forward play, and pauses at frame 1 for
backward play.
\item \texttt{poster}: This is a choice key that takes any of three values: \texttt{first},
\texttt{last}, and \texttt{none}; the default is \texttt{first}.
\item \texttt{speed}: When the anime is played, the value of speed is
the \texttt{initial} or \texttt{default} speed of the animation.
The speed is measured in \emph{milliseconds}.
There are controls for changing the speed dynamically. When the speed
key is not listed, the default speed is 200 milliseconds.
\item \texttt{autorun}: Determines whether the anime plays when
the page is either open or becomes visible; see \texttt{autoplayevent}
below. The default is \texttt{autorun=false}. Listing \texttt{autorun} in the
list of options is the same as \texttt{autorun=true}.
\item \texttt{autopause}: Determines whether the anime pauses when
the page is either closed or becomes invisible; see \texttt{autopauseevent}
below for more detail. The default is \texttt{autopause=false}. Listing \texttt{autopause} in the
list of options is the same as \texttt{autopause=true}.
\item \texttt{autoplayevent}: This is a choice key that takes one of two values:
\texttt{pageopen} or \texttt{pagevisible}. The distinction between
these two only becomes significant when the user is viewing pages
continuously. The default is \texttt{pageopen}.
\item \texttt{autopauseevent}: This is a choice key that takes one of two values:
\texttt{pageclose} or \texttt{pageinvisible}. The distinction between
these two only becomes significant when the user is viewing pages
continuously. The default is \texttt{pageclose}.
\end{itemize}
The following keys concerning the buttons that control the anime.
\begin{itemize}
\item \texttt{ctrlwidth}: The common width of the various control
buttons, the default is \texttt{18bp}.
\item \texttt{ctrlheight}: The common height of the various control
buttons, the default is \texttt{9bp}.
\end{itemize}
\textbf{Note:} The next two keys \texttt{ctrlbdrycolor} and
\texttt{ctrlbdrycolor}, are needed to get the space between the buttons
and the space between the rows correct. These two parameters, under
different names, can be set through \cs{btnAnimeCtrlPresets}, but it is
not recommended that you use this command to set the border color or size, use
the following two keys are part of the key-value list.
\begin{itemize}
\item \texttt{ctrlbdrycolor}: Three numbers representing color in the
RGB space. This color is used as the color of the boundary line for
the button. The default color is transparent, obtained by simply
listing \texttt{ctrlbdrycolor} with no value.
\item \texttt{ctrlbdrywidth}: A choice key determining the width
of the boundary line (or stroke). The choices are
\texttt{thin}, \texttt{medium}, and \texttt{thick}, and correspond
to a boundary line of width \texttt{1bp}, \texttt{2bp}, and \texttt{3bp}, respectively.
The default is \texttt{thin} (\texttt{1bp}).
\item \texttt{controls}: Determines the design of the set of
control buttons. The following values are recognized:
\texttt{none}, \texttt{skin1}, \texttt{skin2}, \texttt{skin3},
\texttt{skin4}, \texttt{skin5}, \texttt{skin6}. When
\texttt{controls=none}, no controls are displayed (better use
\texttt{autoplay}/\texttt{autopause}); skins 1--4 have various
buttons included in them, \texttt{skin1} includes all buttons.
\item[] Values of \texttt{skin5} and \texttt{skin6} are left for the
author to design his/her own button layout. Without a redefinition,
these skins opt to \texttt{skin1}. See the appropriate section of
\texttt{aeb\_pro.dtx} to see who one might create a custom layout.
\item[] The space between control buttons is determined by
\cs{btnanimebtnsep}, the default definition is
\verb!\newcommand{\btnanimebtnsep}{1bp}!.
\item[] \cs{aep@vspacectrlsep}: The vertical space between the
bottom of the anime and the control button set,
\verb!\newcommand{\aep@vspacectrlsep}{3bp}! is the default
definition.
\item \texttt{nospeedcontrol}: There are two buttons for increasing
and decreasing the speed. (The minimal speed is 10 milliseconds, by the
way.) If \texttt{nospeedcontrols} are included in the option list,
then this Plus/Minus pair of buttons are not included in the set of
control buttons.
\item \texttt{usetworows}: If \texttt{usetworows} is in the option
list, then two rows are taken to list all the buttons. The second row
usually consists of the Plus/Minus buttons.
\item[] The vertical space between two rows of buttons is
\cs{btnanimerowsep}, the default definition is
\verb~\newcommand{\btnanimerowsep}{1bp}~.
\end{itemize}
\paragraph*{Controlling the appearance of the Anime Fields.}
You can influence of the appearance of buttons that display the images by
using the command \cs{btnAnimePresets}.
\settowidth{\aebdimen}{\ttfamily\string\btnAnimePresets\darg{\meta{KV-pairs}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\btnAnimePresets{!meta(KV-pairs)}
\end{dCmd}
\PD The key values are ones associated with button form fields, as
described in the eForm reference.
\paragraph*{Controlling the appearance of the Anime Control Buttons.}
You can influence of the appearance of the buttons that provide the
control for the anime by using the command \cs{btnAnimeCtrlPresets}.
\settowidth{\aebdimen}{\ttfamily\string\btnAnimeCtrlPresets\darg{\meta{KV-pairs}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\btnAnimeCtrlPresets{!meta(KV-pairs)}
\end{dCmd}
\PD The key values are ones associated with button form fields, as
described in the eForm reference.
\subsection{The \protect\texttt{ocgAnime} Environment}\label{ss:ocganime}
{\cAEBP} has provided for several years a basic animation feature using
layers (or, in Adobe's terminology, OCG, optional content groups). We
now upgrade OCG animation up to the same level as button anime, much of
the same code is used. Code for OCG anime is include when the \texttt{ocganime}
option is taken.
\exAeBBlogPDF{p=392} The demo file for the material in this section,
is titled \textsl{\texttt{ocgAnime}: Animation using OCG (Layers) with \AEBP} can be found at the
\href{\urlAcroTeXBlog}{{\AcroTeX} Blog} web site.
\newtopic OCG animation is available through the \texttt{ocgAnime}
environment.
\bgroup\obeyspaces%
\settowidth{\aebdimen}{\ttfamily \anglemeta{a set of ocg frames built using \string\animeBld/\string\eBld pairs}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\begin{ocgAnime}{!meta(KV-pairs)}
!anglemeta(a set of ocg frames built using \animeBld/\eBld pairs)
\end{ocgAnime}
\end{dCmd}
\egroup\KVP The key-value pairs are the same ones described in
\hyperref[ss:btnanime]{Section~\ref*{ss:btnanime}} on
page~\pageref*{ss:btnanime}. The \texttt{iconName} key is not recognized
(this is a button anime key), and \texttt{ocg\-Ani\-me\-Name} is an alias for
\texttt{fieldName}, \texttt{ocgAnimeName} being more descriptive of the
base name for the OCG animation. The two keys \texttt{ocgAnimeName} and
\texttt{nFrames} are required.
Below is an example of this syntax.
\begin{Verbatim}[numbers=left,xleftmargin=20pt,fontsize=\fontsize{9}{11}\selectfont]
\begin{ocgAnime}{ocgAnimeName=sineAnime,nFrames=41,
type=palindrome,speed=10,controls=skin1}
\FPdiv{\myDelta}{\psPiTwo}{40}
\def\thisframe{\animeBld\psplot[linecolor=red]{0}{\xi}{sin(x)}\eBld}
\def\xi{0}\psset{algebraic=true}
\psset{llx =-12pt,lly=-12pt,urx =12pt,ury =12pt}
\begin{psgraph*}[arrows=->,trigLabels=true,trigLabelBase=2,
dx=\psPiH](0,0)(-.5,-1.5)(6.75,1.5){164pt}{70pt}%
\rput(4,1){$y=\sin(x)$}%
\animeBld\eBld
\multido{\i=1+1}{40}{\FPadd{\xi}{\xi}{\myDelta}\thisframe}%
\end{psgraph*}
\end{ocgAnime}
\end{Verbatim}
As with \cs{btnAnime}, \cs{placeAnimeCtrlBtnFaces} is used to import the
icon appearances of the control buttons.
\subsection{Moving the Control Buttons}
The default location of the control buttons is below the anime. It is
possible to move them elsewhere. Use the commands \cs{animeSetup} and
\cs{insertCtrlButtons} for this purpose.
\exAeBBlogPDF{p=400} The demo file for the material in this section,
is titled \textsl{Moving the Control Buttons for Button and OCG Animation} can be found at the
\href{\urlAcroTeXBlog}{{\AcroTeX} Blog} web site.
\settowidth{\aebdimen}{\ttfamily\string\animeSetup\darg{\meta{KV-pairs}}}%
\begin{dCmd}[commandchars={!()}]{\aebdimen+2\fboxsep+2\fboxrule}
\animeSetup{!meta(KV-pairs)}
\end{dCmd}
\CmdDescription The argument is the key-value pairs of \cs{btnAnime} or
of the \texttt{ocgAnime} environment. The command processes the key-value
pairs.
Following the execution of \cs{animeSetup}, use \cs{insertCtrlButtons} to
layout the buttons according to the values specified by the key-value
pairs. An example follows.
\begin{Verbatim}[numbers=left,xleftmargin=20pt,fontsize=\fontsize{9}{11}\selectfont]
\begin{minipage}[c]{190pt}\centering
\begin{ocgAnime}{ocgAnimeName=sineAnime,nFrames=41,
type=palindrome,speed=10,controls=none}
\FPdiv{\myDelta}{\psPiTwo}{40}
\def\thisframe{\animeBld\psplot[linecolor=red]{0}{\xi}{sin(x)}\eBld}
\def\xi{0}\psset{algebraic=true}
\psset{llx =-12pt,lly=0pt,urx=12pt,ury=12pt}
\begin{psgraph*}[arrows=->,trigLabels=true,trigLabelBase=2,
dx=\psPiH](0,0)(-.5,-1.5)(6.75,1.5){164pt}{70pt}%
\rput(4,1){$y=\sin(x)$}\animeBld\eBld % first (empty) frame
\multido{\i=1+1}{40}{\FPadd{\xi}{\xi}{\myDelta}\thisframe}%
\end{psgraph*}
\end{ocgAnime}
\end{minipage}\quad{\animeSetup{ocgAnimeName=sineAnime,nFrames=41,
type=palindrome,speed=10,controls=skin3,usetworows}%
\insertCtrlButtons}
\end{Verbatim}
\textbf{Comments:} The key-value pairs passed in line~(2) are minimal,
with \texttt{controls=none}. After closing the \texttt{minipage}
environment in line~(14), we begin with a left-brace (\verb!{!) to enclose
\cs{animeSetup} and \cs{insertCtrlButtons} in a group so all changes in
the parameters are local. In lines~(13)--(16), we execute \cs{animeSetup} with our
selected options, and follow this with \cs{insertCtrlButtons} and we are
done!
\cs{insertCtrlButtons} itself expands to a \cs{parbox},
\cs{insertCtrlButtons} has an optional parameter that is passed to the
optional parameter of the underlying \cs{parbox}, permissible values are
\texttt{c} (the default), \texttt{b}, and \texttt{t}.
Note that if you want to use \texttt{autorun} and \texttt{autoresume},
these parameters must be passed in the parameter set of \texttt{ocgAnime},
not from the parameter set of \cs{animeSetup}
Rather just enclosing \cs{animeSetup} and \cs{insertCtrlButtons} in
grouping braces, you could also use a \cs{parbox}, and add, perhaps, a
caption.
In theory, the control button can be placed anywhere on the page, above
the anime, below it, to the left or to the right of it.
\exAeBBlogPDF{p=405} The \href{\urlAcroTeXBlog}{{\AcroTeX} Blog} post
titled \textsl{Custom Designing Anime Control Button Layout} shows how to
design your own button layout, and how to define your own ``skin.''
One last command, \cs{insertCtrlButtons} is normally expanded at the end
of the \cs{btnAnime} or \texttt{ocgAnime} environments. It appears in the
form
\begin{Verbatim}
\ctrlButtonsWrapper{\insertCtrlButtons}
\end{Verbatim}
\exAeBBlogPDF{p=418} The command \cs{ctrlButtonsWrapper} can be redefined to create special
effects, as illustrated in the \href{\urlAcroTeXBlog}{{\AcroTeX} Blog} post titled \textsl{Some Comments on Anime Button
Layouts}.
\newpage
\markright{References}
\parskip0pt
\begin{thebibliography}{[1]} %\label{references}
\addcontentsline{toc}{section}{\protect\numberline{}References}
\backrefparscanfalse
\def\srtln{\vskip-\baselineskip\vskip-\parsep}
\def\lngln{\vskip-\parsep}
\bibitem{TUG:execJS} ``\texttt{execJS}: A new technique for introducing discardable
JavaScript into a PDF from a \LaTeX{} source,'' TUGBoat, The
Communications of the \TeX{} User Group, Vol.~22, No.~4, pp.\
265-268 (2001). \backrefprint
\bibitem{tech:AcroJSRef}
JavaScript for Acrobat® API Reference, Adobe® Acrobat® SDK, Version~8.0.,
Adobe Systems, Inc., 2006. \backrefprint
\lngln\hfill{\small\url{http://www.adobe.com/go/acrobat_developer}}
\bibitem{tech:AcroJSGuide}
Developing Acrobat® Applications Using JavaScript, Version~8.0.,
Adobe Systems, Inc., 2006. \backrefprint
\srtln\hfill{\small\url{http://www.adobe.com/go/acrobat_developer}}
\bibitem{tech:pdfmark}
pdfmark Reference Manual, Version~8.0, Adobe® Acrobat® SDK, Version~8.0, 2006. \backrefprint
\srtln\hfill{\small\url{http://www.adobe.com/go/acrobat_developer}}
\bibitem{tech:PDFRef}
PDF Reference, Version~1.7., Adobe Systems, Inc., 2006. \backrefprint
\lngln\hfill{\small\url{http://www.adobe.com/go/acrobat_developer}}
\bibitem{book:AEBB}
D. P. Story, \textsl{\AEBBook}, in preparation. \backrefprint
\end{thebibliography}
\noindent
Now, I simply must get back to my retirement. \dps
%\newpage
%\leftskip20pt\rightskip20pt\small
%\addcontentsline{toc}{section}{\protect\numberline{}Index}
%\markright{Index}
%\printindex
\end{document}
\section{Resources}
\newtopic The resources for the development of this package are
\begin{itemize}
% \item \textsl{Standard ECMA-357: ECMAScript for XML (E4X) Specification},\\
% \url{http://www.ecma-international.org/publications/standards/Ecma-357.htm}
% \item \textsl{XMP Specification}, \url{http://www.adobe.com/go/acrobat_developer}
\item \textsl{Acrobat JavaScript Scripting Reference}, Version 8.0\\
\url{http://www.adobe.com/go/acrobat_developer}
% \item \textsf{hyperxmp} package by Scott Pakin.\\
% \url{ftp://cam.ctan.org/tex-archive/macros/latex/contrib/hyperxmp/}
% \item The {\AcroTeX} System Tools, available for free download at \url{www.acrotex.net}. This is
% a {\LaTeX}-based system.
\end{itemize}
After you download the zip file (available in
http://www.math.uakron.edu/~dpstory/aeb_pro/aebpro_pack.zip), expand it by
double-clicking on it.
Place the folder inside ~/Library/texmf/tex/latex (here ~ is your home
directory; inside there is a folder called Library; if necessary, create a
folder named tex inside it, and then a folder called latex inside that;
NOTE: if you are using Mac OS X 10.7 (Lion), the Library folder is hidden
by default - to open it, hold down the option key and click on the "Go"
menu in the Finder to make it appear).
Also, check the pdf manual that comes with the software.
Luis Sequeira
> P.S. I use TexLive, I have Acrobat Professional and Distiller. How is possible to have the workflow you said me (Latex-->dvi-->distiller-->pdf) with TexShop? XeLateX is right?
The easiest way to have the required workflow in TeXShop is to add a special comment line at the top of your file (it is a comment as far as TeX is concerned, beginning with the comment character '%' ; but TeXShop looks at the first lines of the source file for this and other similar information and calls the appropriate commands accordingly):
%! TEX TS-program = latex
Similarly, you can replace 'latex' with 'pdflatex' or 'xelatex' to get your source automatically typeset with a different engine.
As to using XeLaTeX, if you want to use it in documents containing pstricks stuff, you'll need to use the package auto-pst-pdf:
\usepackage{auto-pst-pdf}
Note: TeXShop is an excellent front-end to all things TeX-related. Since it is Mac-only, you may get more help more quickly for things specific to TeXShop in the Mac OS X TeX mailing list.
|