main
Matthew Butterick 6 years ago
parent 42f5f93199
commit fd34ea3c00

@ -1,5 +1,5 @@
#lang debug racket
(require rackunit)
(require rackunit (prefix-in zlib: pitfall/zlib))
(provide (all-defined-out))
(define (xref-offset bs)
@ -66,12 +66,14 @@
(apply cons kv))
bytes<?
#:key car))
(cond
(cond ;; might have a stream
[(regexp-try-match #px"^\\s*stream\n" ip)
(define stream-length
(read (open-input-bytes (cdr (assoc #"/Length" dic)))))
(define stream (read-bytes stream-length ip))
(append dic (list (cons 'stream stream)))]
(append dic (list (cons 'stream (if #R (dict-ref dic '/FlateDecode #f)
(zlib:inflate stream)
stream))))]
[else dic])]
[else
(pat-lex ip
@ -116,7 +118,13 @@
(unless (equal? k1 k2)
(error (format "keys unequal: ~a ~a" k1 k2)))
(unless (equal? v1 v2)
(error (format "values unequal: ~a ~a" v1 v2)))
(define val1 (if (and (bytes? v1) (> (bytes-length v1) 200))
(subbytes v1 0 200)
v1))
(define val2 (if (and (bytes? v2) (> (bytes-length v2) 200))
(subbytes v2 0 200)
v2))
(error (format "values unequal: ~a ~a" val1 val2)))
(when (dict? v1)
(dict-compare v1 v2))
#true)))

Binary file not shown.

@ -14,25 +14,25 @@ endobj
endobj
5 0 obj
<<
/Parent 1 0 R
/Resources 4 0 R
/Contents 3 0 R
/MediaBox [0 0 612 792]
/Type /Page
/Parent 1 0 R
>>
endobj
4 0 obj
<<
/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
/ExtGState <<
/Gs2 7 0 R
/Gs1 6 0 R
>>
/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
>>
endobj
3 0 obj
<<
/Length 99667
/Length 100994
>>
stream
1 0 0 -1 0 792 cm
@ -334,7 +334,7 @@ B
-75.4 112.401 299.717 80.245 299.717 80.245 c
h
/DeviceRGB cs
0.8 0.447059 0.14902 scn
0.8 0.4470588235294118 0.14901960784313725 scn
/Gs1 gs
/DeviceRGB CS
0 0 0 SCN
@ -360,7 +360,7 @@ B
-115.6 102.6 l
h
/DeviceRGB cs
0.8 0.447059 0.14902 scn
0.8 0.4470588235294118 0.14901960784313725 scn
/Gs1 gs
f
133.51 25.346 m
@ -383,7 +383,7 @@ f
179.11 49.346 139.91 24.546 133.51 25.346 c
h
/DeviceRGB cs
0.909804 0.498039 0.227451 scn
0.9098039215686274 0.4980392156862745 0.22745098039215686 scn
/Gs1 gs
f
134.819 27.091 m
@ -406,7 +406,7 @@ f
180.419 51.092 141.219 26.291 134.819 27.091 c
h
/DeviceRGB cs
0.917647 0.54902 0.301961 scn
0.9176470588235294 0.5490196078431373 0.30196078431372547 scn
/Gs1 gs
f
136.128 28.837 m
@ -429,7 +429,7 @@ f
181.728 52.837 142.528 28.037 136.128 28.837 c
h
/DeviceRGB cs
0.92549 0.6 0.380392 scn
0.9254901960784314 0.6 0.3803921568627451 scn
/Gs1 gs
f
137.438 30.583 m
@ -452,7 +452,7 @@ f
183.038 54.583 143.838 29.783 137.438 30.583 c
h
/DeviceRGB cs
0.933333 0.647059 0.458824 scn
0.9333333333333333 0.6470588235294118 0.4588235294117647 scn
/Gs1 gs
f
138.747 32.328 m
@ -475,7 +475,7 @@ f
184.347 56.328 145.147 31.528 138.747 32.328 c
h
/DeviceRGB cs
0.945098 0.698039 0.533333 scn
0.9450980392156862 0.6980392156862745 0.5333333333333333 scn
/Gs1 gs
f
140.056 34.073 m
@ -498,7 +498,7 @@ f
185.656 58.074 146.456 33.273 140.056 34.073 c
h
/DeviceRGB cs
0.952941 0.74902 0.611765 scn
0.9529411764705882 0.7490196078431373 0.611764705882353 scn
/Gs1 gs
f
141.365 35.819 m
@ -521,7 +521,7 @@ f
186.965 59.819 147.765 35.019 141.365 35.819 c
h
/DeviceRGB cs
0.960784 0.8 0.690196 scn
0.9607843137254902 0.8 0.6901960784313725 scn
/Gs1 gs
f
142.674 37.565 m
@ -544,7 +544,7 @@ f
188.274 61.565 149.074 36.765 142.674 37.565 c
h
/DeviceRGB cs
0.972549 0.847059 0.768627 scn
0.9725490196078431 0.8470588235294118 0.7686274509803922 scn
/Gs1 gs
f
143.983 39.31 m
@ -567,7 +567,7 @@ f
189.583 63.31 150.383 38.51 143.983 39.31 c
h
/DeviceRGB cs
0.980392 0.898039 0.843137 scn
0.9803921568627451 0.8980392156862745 0.8431372549019608 scn
/Gs1 gs
f
145.292 41.055 m
@ -590,7 +590,7 @@ f
190.892 65.056 151.692 40.255 145.292 41.055 c
h
/DeviceRGB cs
0.988235 0.94902 0.921569 scn
0.9882352941176471 0.9490196078431372 0.9215686274509803 scn
/Gs1 gs
f
-115.8 119.601 m
@ -760,7 +760,7 @@ f
56.6 175.601 -7.8 175.601 -7.8 175.601 c
h
/DeviceRGB cs
0.898039 0.4 0.54902 scn
0.8980392156862745 0.4 0.5490196078431373 scn
/Gs1 gs
f
-9.831 206.497 m
@ -771,7 +771,7 @@ f
-9.831 206.497 l
h
/DeviceRGB cs
0.698039 0.196078 0.34902 scn
0.6980392156862745 0.19607843137254902 0.34901960784313724 scn
/Gs1 gs
f
-5.4 222.801 m
@ -788,7 +788,7 @@ f
61.4 214.401 -5.4 222.801 -5.4 222.801 c
h
/DeviceRGB cs
0.647059 0.14902 0.298039 scn
0.6470588235294118 0.14901960784313725 0.2980392156862745 scn
/Gs1 gs
f
-9.8 174.401 m
@ -804,7 +804,7 @@ f
22.2 184.001 20.2 167.201 -9.8 174.401 c
h
/DeviceRGB cs
1 0.447059 0.498039 scn
1 0.4470588235294118 0.4980392156862745 scn
/Gs1 gs
/DeviceRGB CS
0 0 0 SCN
@ -835,7 +835,7 @@ B
47.4 189.201 70.142 188.029 71.742 185.229 c
h
/DeviceRGB cs
0.8 0.247059 0.298039 scn
0.8 0.24705882352941178 0.2980392156862745 scn
/Gs1 gs
f
28.6 175.201 m
@ -846,7 +846,7 @@ f
0 0 0 scn
/Gs1 gs
/DeviceRGB CS
0.647059 0.098039 0.14902 SCN
0.6470588235294118 0.09803921568627451 0.14901960784313725 SCN
/Gs2 gs
B
-19.4 260.001 m
@ -936,7 +936,7 @@ B
0 0 0 scn
/Gs1 gs
/DeviceRGB CS
0.647059 0.14902 0.298039 SCN
0.6470588235294118 0.14901960784313725 0.2980392156862745 SCN
/Gs2 gs
B
15.8 253.601 m
@ -948,7 +948,7 @@ B
0 0 0 scn
/Gs1 gs
/DeviceRGB CS
0.647059 0.14902 0.298039 SCN
0.6470588235294118 0.14901960784313725 0.2980392156862745 SCN
/Gs2 gs
B
33 237.601 m
@ -973,7 +973,7 @@ B
0 0 0 scn
/Gs1 gs
/DeviceRGB CS
0.647059 0.14902 0.298039 SCN
0.6470588235294118 0.14901960784313725 0.2980392156862745 SCN
/Gs2 gs
B
53.5 228.401 m
@ -983,7 +983,7 @@ B
0 0 0 scn
/Gs1 gs
/DeviceRGB CS
0.647059 0.14902 0.298039 SCN
0.6470588235294118 0.14901960784313725 0.2980392156862745 SCN
/Gs2 gs
B
-25.8 265.201 m
@ -993,7 +993,7 @@ B
-23.8 267.601 -35.4 262.001 -25.8 265.201 c
h
/DeviceRGB cs
0.698039 0.698039 0.698039 scn
0.6980392156862745 0.6980392156862745 0.6980392156862745 scn
/Gs1 gs
f
-11.8 172.001 m
@ -1128,7 +1128,7 @@ B
-74.792 183.132 l
h
/DeviceRGB cs
0.898039 0.898039 0.698039 scn
0.8980392156862745 0.8980392156862745 0.6980392156862745 scn
/Gs1 gs
f
-9.724 178.47 m
@ -1139,7 +1139,7 @@ f
8.564 178.68 -1.524 176.67 -9.724 178.47 c
h
/DeviceRGB cs
0.898039 0.898039 0.698039 scn
0.8980392156862745 0.8980392156862745 0.6980392156862745 scn
/Gs1 gs
f
43.88 40.321 m
@ -1153,7 +1153,7 @@ f
46.44 34.741 16.16 36.361 43.88 40.321 c
h
/DeviceRGB cs
0.8 0.447059 0.14902 scn
0.8 0.4470588235294118 0.14901960784313725 scn
/Gs1 gs
f
8.088 -33.392 m
@ -1167,7 +1167,7 @@ f
27.528 -58.016 9.384 -35.12 8.088 -33.392 c
h
/DeviceRGB cs
0.917647 0.556863 0.317647 scn
0.9176470588235294 0.5568627450980392 0.3176470588235294 scn
/Gs1 gs
f
8.816 -32.744 m
@ -1181,7 +1181,7 @@ f
27.896 -56.912 10.088 -34.44 8.816 -32.744 c
h
/DeviceRGB cs
0.937255 0.666667 0.486275 scn
0.9372549019607843 0.6666666666666666 0.48627450980392156 scn
/Gs1 gs
f
9.544 -32.096 m
@ -1195,7 +1195,7 @@ f
28.264 -55.808 10.792 -33.76 9.544 -32.096 c
h
/DeviceRGB cs
0.956863 0.776471 0.658824 scn
0.9568627450980393 0.7764705882352941 0.6588235294117647 scn
/Gs1 gs
f
10.272 -31.448 m
@ -1209,7 +1209,7 @@ f
28.632 -54.704 11.496 -33.08 10.272 -31.448 c
h
/DeviceRGB cs
0.976471 0.886275 0.827451 scn
0.9764705882352941 0.8862745098039215 0.8274509803921568 scn
/Gs1 gs
f
44.2 36.8 m
@ -1258,7 +1258,7 @@ f
59.446 31.449 53.874 36.514 47 36.514 c
h
/DeviceRGB cs
0.6 0.8 0.196078 scn
0.6 0.8 0.19607843137254902 scn
/Gs1 gs
f
43.377 19.83 m
@ -1268,7 +1268,7 @@ f
57.32 18.875 52.004 18.545 43.377 19.83 c
h
/DeviceRGB cs
0.396078 0.6 0 scn
0.396078431372549 0.6 0 scn
/Gs1 gs
f
55.4 19.6 m
@ -1305,7 +1305,7 @@ f
-63.764 27.129 -60.6 20.4 -58.6 14.4 c
h
/DeviceRGB cs
0.8 0.447059 0.14902 scn
0.8 0.4470588235294118 0.14901960784313725 scn
/Gs1 gs
f
-59.6 12.56 m
@ -1343,7 +1343,7 @@ f
-49.49 -24.28 -49.88 -41.83 -51.05 -42.61 c
h
/DeviceRGB cs
0.921569 0.584314 0.360784 scn
0.9215686274509803 0.5843137254901961 0.3607843137254902 scn
/Gs1 gs
f
-51.5 -41.62 m
@ -1362,7 +1362,7 @@ f
-49.98 -23.76 -50.36 -40.86 -51.5 -41.62 c
h
/DeviceRGB cs
0.94902 0.721569 0.572549 scn
0.9490196078431372 0.7215686274509804 0.5725490196078431 scn
/Gs1 gs
f
-51.95 -40.63 m
@ -1381,7 +1381,7 @@ f
-50.47 -23.24 -50.84 -39.89 -51.95 -40.63 c
h
/DeviceRGB cs
0.972549 0.862745 0.784314 scn
0.9725490196078431 0.8627450980392157 0.7843137254901961 scn
/Gs1 gs
f
-59.6 12.46 m
@ -1427,7 +1427,7 @@ f
-70.152 19.911 -72.382 9.69 -71.4 3.8 c
h
/DeviceRGB cs
0.6 0.8 0.196078 scn
0.6 0.8 0.19607843137254902 scn
/Gs1 gs
f
14.595 46.349 m
@ -1516,7 +1516,7 @@ f
250.618 -77.536 265.808 -107.24 263.648 -120.632 c
h
/DeviceRGB cs
0.196078 0.196078 0.196078 scn
0.19607843137254902 0.19607843137254902 0.19607843137254902 scn
/Gs1 gs
f
263.274 -120.274 m
@ -1593,7 +1593,7 @@ f
50.6 84 l
h
/DeviceRGB cs
0.6 0.14902 0 scn
0.6 0.14901960784313725 0 scn
/Gs1 gs
f
189 278 m
@ -1763,7 +1763,7 @@ f
186.401 -110.6 186.801 -109 180.801 -106.4 c
h
/DeviceRGB cs
0.8 0.447059 0.14902 scn
0.8 0.4470588235294118 0.14901960784313725 scn
/Gs1 gs
f
168.33 -108.509 m
@ -1805,7 +1805,7 @@ f
166.821 -109.239 167.697 -109.005 168.33 -108.509 c
h
/DeviceRGB cs
0.8 0.447059 0.14902 scn
0.8 0.4470588235294118 0.14901960784313725 scn
/Gs1 gs
f
91.696 -122.739 m
@ -1832,7 +1832,7 @@ f
93.48 -123.547 92.581 -122.132 91.696 -122.739 c
h
/DeviceRGB cs
0.8 0.447059 0.14902 scn
0.8 0.4470588235294118 0.14901960784313725 scn
/Gs1 gs
f
59.198 -115.391 m
@ -1861,7 +1861,7 @@ f
67.591 -113.679 63.585 -114.287 59.198 -115.391 c
h
/DeviceRGB cs
0.8 0.447059 0.14902 scn
0.8 0.4470588235294118 0.14901960784313725 scn
/Gs1 gs
f
45.338 -71.179 m
@ -1875,7 +1875,7 @@ f
45.763 -70.148 46.093 -70.601 45.338 -71.179 c
h
/DeviceRGB cs
0.8 0.447059 0.14902 scn
0.8 0.4470588235294118 0.14901960784313725 scn
/Gs1 gs
f
17.8 -123.756 m
@ -1885,7 +1885,7 @@ f
9.268 -120.135 17.534 -123.756 17.8 -123.756 c
h
/DeviceRGB cs
0.8 0.447059 0.14902 scn
0.8 0.4470588235294118 0.14901960784313725 scn
/Gs1 gs
f
33.2 -114 m
@ -1981,7 +1981,7 @@ f
0 0 0 scn
/Gs1 gs
/DeviceRGB CS
0.298039 0 0 SCN
0.2980392156862745 0 0 SCN
/Gs2 gs
B
24.8 64.2 m
@ -1992,7 +1992,7 @@ B
0 0 0 scn
/Gs1 gs
/DeviceRGB CS
0.298039 0 0 SCN
0.2980392156862745 0 0 SCN
/Gs2 gs
B
21.2 63 m
@ -2004,7 +2004,7 @@ B
0 0 0 scn
/Gs1 gs
/DeviceRGB CS
0.298039 0 0 SCN
0.2980392156862745 0 0 SCN
/Gs2 gs
B
22.2 63.4 m
@ -2016,7 +2016,7 @@ B
0 0 0 scn
/Gs1 gs
/DeviceRGB CS
0.298039 0 0 SCN
0.2980392156862745 0 0 SCN
/Gs2 gs
B
20.895 54.407 m
@ -2200,7 +2200,7 @@ f
6.4 51.6 2.6 45.6 -3 42.8 c
h
/DeviceRGB cs
0.298039 0 0 scn
0.2980392156862745 0 0 scn
/Gs1 gs
f
-61.009 11.603 m
@ -2210,7 +2210,7 @@ f
-71.576 8.599 -66.708 14.118 -61.009 11.603 c
h
/DeviceRGB cs
0.6 0.8 0.196078 scn
0.6 0.8 0.19607843137254902 scn
/Gs1 gs
f
-61.009 11.403 m
@ -2220,7 +2220,7 @@ f
-71.576 8.499 -67.308 13.618 -61.009 11.403 c
h
/DeviceRGB cs
0.396078 0.6 0 scn
0.396078431372549 0.6 0 scn
/Gs1 gs
f
-65.4 11.546 m
@ -2275,7 +2275,7 @@ f
-113 119.201 -112.2 113.601 -112.2 113.601 c
h
/DeviceRGB cs
0.898039 0.6 0.6 scn
0.8980392156862745 0.6 0.6 scn
/Gs1 gs
f
-109 131.051 m
@ -2293,7 +2293,7 @@ f
-101.8 138.001 -104.6 137.601 -109 132.401 c
h
/DeviceRGB cs
0.698039 0.396078 0.396078 scn
0.6980392156862745 0.396078431372549 0.396078431372549 scn
/Gs1 gs
f
-111.6 110.001 m
@ -2318,7 +2318,7 @@ f
-111.6 110.001 l
h
/DeviceRGB cs
0.6 0.14902 0 scn
0.6 0.14901960784313725 0 scn
/Gs1 gs
f
-120.2 114.601 m
@ -2346,7 +2346,7 @@ f
-99.8 53.5 -94.1 51.2 -98.6 54 c
h
/DeviceRGB cs
0.6 0.14902 0 scn
0.6 0.14901960784313725 0 scn
/Gs1 gs
f
40.8 -12.2 m
@ -2846,7 +2846,7 @@ f
-78.2 40.4 -76.6 41.2 -76.6 41.2 c
h
/DeviceRGB cs
0.6 0.14902 0 scn
0.6 0.14901960784313725 0 scn
/Gs1 gs
f
-95 55.2 m
@ -2855,7 +2855,7 @@ f
-98.2 58.4 -95 55.2 -95 55.2 c
h
/DeviceRGB cs
0.6 0.14902 0 scn
0.6 0.14901960784313725 0 scn
/Gs1 gs
f
-74.2 -19.4 m
@ -3818,8 +3818,8 @@ endobj
8 0 obj
<<
/CreationDate (D:19700101000000Z)
/Creator (PITKIT)
/Producer (PITKIT)
/Creator (PITKIT)
>>
endobj
2 0 obj
@ -3831,27 +3831,27 @@ endobj
1 0 obj
<<
/Kids [5 0 R]
/Count 1
/Type /Pages
/Count 1
>>
endobj
xref
0 9
0000000000 65535 f
0000100174 00000 n
0000100125 00000 n
0000101502 00000 n
0000101453 00000 n
0000000313 00000 n
0000000207 00000 n
0000000103 00000 n
0000000015 00000 n
0000000059 00000 n
0000100033 00000 n
0000101361 00000 n
trailer
<<
/Info 8 0 R
/Root 2 0 R
/Size 9
/Root 2 0 R
/Info 8 0 R
>>
startxref
100231
101559
%%EOF

Loading…
Cancel
Save