2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-10-31 19:02:30 +00:00

Don't lose character after \d or \dd parsing string (fixes #1050)

This commit is contained in:
Jay Berkenbilt 2023-10-14 17:04:58 -04:00
parent 467e5d6226
commit 1ecc6bb29e
8 changed files with 1043 additions and 1003 deletions

View File

@ -1,3 +1,11 @@
2023-10-14 Jay Berkenbilt <ejb@ql.org>
* Fix serious bug: qpdf could discard a the character after an
escaped octal string. For content, this would only happen with QDF
or when normalizing content, but it could have happened in a
binary string. This bug was introduced between 10.6.3 and 11.0.0.
Fixes #1050.
2023-10-07 Jay Berkenbilt <ejb@ql.org> 2023-10-07 Jay Berkenbilt <ejb@ql.org>
* 11.6.2: release * 11.6.2: release

View File

@ -145,9 +145,8 @@ QPDFTokenizer::presentCharacter(char ch)
void void
QPDFTokenizer::handleCharacter(char ch) QPDFTokenizer::handleCharacter(char ch)
{ {
// State machine is implemented such that the final character may not be handled. This happens // In some cases, functions called below may call a second handler. This happens whenever you
// whenever you have to use a character from the next token to detect the end of the current // have to use a character from the next token to detect the end of the current token.
// token.
switch (this->state) { switch (this->state) {
case st_top: case st_top:
@ -692,16 +691,21 @@ QPDFTokenizer::inHexstring2nd(char ch)
void void
QPDFTokenizer::inCharCode(char ch) QPDFTokenizer::inCharCode(char ch)
{ {
bool handled = false;
if (('0' <= ch) && (ch <= '7')) { if (('0' <= ch) && (ch <= '7')) {
this->char_code = 8 * this->char_code + (int(ch) - int('0')); this->char_code = 8 * this->char_code + (int(ch) - int('0'));
if (++(this->digit_count) < 3) { if (++(this->digit_count) < 3) {
return; return;
} }
// We've accumulated \ddd. PDF Spec says to ignore high-order overflow. handled = true;
} }
// We've accumulated \ddd or we have \d or \dd followed by other than an octal digit. The PDF
// Spec says to ignore high-order overflow.
this->val += char(this->char_code % 256); this->val += char(this->char_code % 256);
this->state = st_in_string; this->state = st_in_string;
return; if (!handled) {
inString(ch);
}
} }
void void

View File

@ -181,352 +181,352 @@ skipping to endstream
7121: space: \x0a 7121: space: \x0a
7122: word: stream 7122: word: stream
skipping to endstream skipping to endstream
7469: word: endstream 7524: word: endstream
7478: space: \x0a 7533: space: \x0a
7479: word: endobj 7534: word: endobj
7485: space: \x0a\x0a 7540: space: \x0a\x0a
7487: integer: 44 7542: integer: 44
7489: space: 7544: space:
7490: integer: 0 7545: integer: 0
7491: space: 7546: space:
7492: word: obj 7547: word: obj
7495: space: \x0a 7550: space: \x0a
7496: integer: 340 7551: integer: 395
7499: space: \x0a 7554: space: \x0a
7500: word: endobj 7555: word: endobj
7506: space: \x0a\x0a 7561: space: \x0a\x0a
7508: comment: %% Contents for page 5 7563: comment: %% Contents for page 5
7530: space: \x0a 7585: space: \x0a
7531: comment: %% Original object ID: 41 0 7586: comment: %% Original object ID: 41 0
7558: space: \x0a 7613: space: \x0a
7559: integer: 45 7614: integer: 45
7561: space: 7616: space:
7562: integer: 0 7617: integer: 0
7563: space: 7618: space:
7564: word: obj 7619: word: obj
7567: space: \x0a 7622: space: \x0a
7568: dict_open: << 7623: dict_open: <<
7570: space: \x0a 7625: space: \x0a
7573: name: /Length 7628: name: /Length
7580: space: 7635: space:
7581: integer: 46 7636: integer: 46
7583: space: 7638: space:
7584: integer: 0 7639: integer: 0
7585: space: 7640: space:
7586: word: R 7641: word: R
7587: space: \x0a 7642: space: \x0a
7588: dict_close: >> 7643: dict_close: >>
7590: space: \x0a 7645: space: \x0a
7591: word: stream 7646: word: stream
skipping to endstream skipping to endstream
7666: word: endstream 7721: word: endstream
7675: space: \x0a 7730: space: \x0a
7676: word: endobj 7731: word: endobj
7682: space: \x0a 7737: space: \x0a
7683: comment: %QDF: ignore_newline 7738: comment: %QDF: ignore_newline
7703: space: \x0a\x0a 7758: space: \x0a\x0a
7705: integer: 46 7760: integer: 46
7707: space: 7762: space:
7708: integer: 0 7763: integer: 0
7709: space: 7764: space:
7710: word: obj 7765: word: obj
7713: space: \x0a 7768: space: \x0a
7714: integer: 67 7769: integer: 67
7716: space: \x0a 7771: space: \x0a
7717: word: endobj 7772: word: endobj
7723: space: \x0a\x0a 7778: space: \x0a\x0a
7725: comment: %% Contents for page 6 7780: comment: %% Contents for page 6
7747: space: \x0a 7802: space: \x0a
7748: comment: %% Original object ID: 42 0 7803: comment: %% Original object ID: 42 0
7775: space: \x0a 7830: space: \x0a
7776: integer: 47 7831: integer: 47
7778: space: 7833: space:
7779: integer: 0 7834: integer: 0
7780: space: 7835: space:
7781: word: obj 7836: word: obj
7784: space: \x0a 7839: space: \x0a
7785: dict_open: << 7840: dict_open: <<
7787: space: \x0a 7842: space: \x0a
7790: name: /Length 7845: name: /Length
7797: space: 7852: space:
7798: integer: 48 7853: integer: 48
7800: space: 7855: space:
7801: integer: 0 7856: integer: 0
7802: space: 7857: space:
7803: word: R 7858: word: R
7804: space: \x0a 7859: space: \x0a
7805: dict_close: >> 7860: dict_close: >>
7807: space: \x0a 7862: space: \x0a
7808: word: stream 7863: word: stream
skipping to endstream skipping to endstream
7859: word: endstream 7914: word: endstream
7868: space: \x0a 7923: space: \x0a
7869: word: endobj 7924: word: endobj
7875: space: \x0a\x0a 7930: space: \x0a\x0a
7877: integer: 48 7932: integer: 48
7879: space: 7934: space:
7880: integer: 0 7935: integer: 0
7881: space: 7936: space:
7882: word: obj 7937: word: obj
7885: space: \x0a 7940: space: \x0a
7886: integer: 44 7941: integer: 44
7888: space: \x0a 7943: space: \x0a
7889: word: endobj 7944: word: endobj
7895: space: \x0a\x0a 7950: space: \x0a\x0a
7897: comment: %% Contents for page 7 7952: comment: %% Contents for page 7
7919: space: \x0a 7974: space: \x0a
7920: comment: %% Original object ID: 43 0 7975: comment: %% Original object ID: 43 0
7947: space: \x0a 8002: space: \x0a
7948: integer: 49 8003: integer: 49
7950: space: 8005: space:
7951: integer: 0 8006: integer: 0
7952: space: 8007: space:
7953: word: obj 8008: word: obj
7956: space: \x0a 8011: space: \x0a
7957: dict_open: << 8012: dict_open: <<
7959: space: \x0a 8014: space: \x0a
7962: name: /Length 8017: name: /Length
7969: space: 8024: space:
7970: integer: 50 8025: integer: 50
7972: space: 8027: space:
7973: integer: 0 8028: integer: 0
7974: space: 8029: space:
7975: word: R 8030: word: R
7976: space: \x0a 8031: space: \x0a
7977: dict_close: >> 8032: dict_close: >>
7979: space: \x0a 8034: space: \x0a
7980: word: stream 8035: word: stream
skipping to endstream skipping to endstream
8306: word: endstream 8361: word: endstream
8315: space: \x0a 8370: space: \x0a
8316: word: endobj 8371: word: endobj
8322: space: \x0a 8377: space: \x0a
8323: comment: %QDF: ignore_newline 8378: comment: %QDF: ignore_newline
8343: space: \x0a\x0a 8398: space: \x0a\x0a
8345: integer: 50 8400: integer: 50
8347: space: 8402: space:
8348: integer: 0 8403: integer: 0
8349: space: 8404: space:
8350: word: obj 8405: word: obj
8353: space: \x0a 8408: space: \x0a
8354: integer: 318 8409: integer: 318
8357: space: \x0a 8412: space: \x0a
8358: word: endobj 8413: word: endobj
8364: space: \x0a\x0a 8419: space: \x0a\x0a
8366: comment: %% Contents for page 8 8421: comment: %% Contents for page 8
8388: space: \x0a 8443: space: \x0a
8389: comment: %% Original object ID: 44 0 8444: comment: %% Original object ID: 44 0
8416: space: \x0a 8471: space: \x0a
8417: integer: 51 8472: integer: 51
8419: space: 8474: space:
8420: integer: 0 8475: integer: 0
8421: space: 8476: space:
8422: word: obj 8477: word: obj
8425: space: \x0a 8480: space: \x0a
8426: dict_open: << 8481: dict_open: <<
8428: space: \x0a 8483: space: \x0a
8431: name: /Length 8486: name: /Length
8438: space: 8493: space:
8439: integer: 52 8494: integer: 52
8441: space: 8496: space:
8442: integer: 0 8497: integer: 0
8443: space: 8498: space:
8444: word: R 8499: word: R
8445: space: \x0a 8500: space: \x0a
8446: dict_close: >> 8501: dict_close: >>
8448: space: \x0a 8503: space: \x0a
8449: word: stream 8504: word: stream
skipping to endstream skipping to endstream
8500: word: endstream 8555: word: endstream
8509: space: \x0a 8564: space: \x0a
8510: word: endobj 8565: word: endobj
8516: space: \x0a\x0a 8571: space: \x0a\x0a
8518: integer: 52 8573: integer: 52
8520: space: 8575: space:
8521: integer: 0 8576: integer: 0
8522: space: 8577: space:
8523: word: obj 8578: word: obj
8526: space: \x0a 8581: space: \x0a
8527: integer: 44 8582: integer: 44
8529: space: \x0a 8584: space: \x0a
8530: word: endobj 8585: word: endobj
8536: space: \x0a\x0a 8591: space: \x0a\x0a
8538: comment: %% Contents for page 9 8593: comment: %% Contents for page 9
8560: space: \x0a 8615: space: \x0a
8561: comment: %% Original object ID: 45 0 8616: comment: %% Original object ID: 45 0
8588: space: \x0a 8643: space: \x0a
8589: integer: 53 8644: integer: 53
8591: space: 8646: space:
8592: integer: 0 8647: integer: 0
8593: space: 8648: space:
8594: word: obj 8649: word: obj
8597: space: \x0a 8652: space: \x0a
8598: dict_open: << 8653: dict_open: <<
8600: space: \x0a 8655: space: \x0a
8603: name: /Length 8658: name: /Length
8610: space: 8665: space:
8611: integer: 54 8666: integer: 54
8613: space: 8668: space:
8614: integer: 0 8669: integer: 0
8615: space: 8670: space:
8616: word: R 8671: word: R
8617: space: \x0a 8672: space: \x0a
8618: dict_close: >> 8673: dict_close: >>
8620: space: \x0a 8675: space: \x0a
8621: word: stream 8676: word: stream
skipping to endstream skipping to endstream
8672: word: endstream 8727: word: endstream
8681: space: \x0a 8736: space: \x0a
8682: word: endobj 8737: word: endobj
8688: space: \x0a\x0a 8743: space: \x0a\x0a
8690: integer: 54 8745: integer: 54
8692: space: 8747: space:
8693: integer: 0 8748: integer: 0
8694: space: 8749: space:
8695: word: obj 8750: word: obj
8698: space: \x0a 8753: space: \x0a
8699: integer: 44 8754: integer: 44
8701: space: \x0a 8756: space: \x0a
8702: word: endobj 8757: word: endobj
8708: space: \x0a\x0a 8763: space: \x0a\x0a
8710: comment: %% Contents for page 10 8765: comment: %% Contents for page 10
8733: space: \x0a 8788: space: \x0a
8734: comment: %% Original object ID: 46 0 8789: comment: %% Original object ID: 46 0
8761: space: \x0a 8816: space: \x0a
8762: integer: 55 8817: integer: 55
8764: space: 8819: space:
8765: integer: 0 8820: integer: 0
8766: space: 8821: space:
8767: word: obj 8822: word: obj
8770: space: \x0a 8825: space: \x0a
8771: dict_open: << 8826: dict_open: <<
8773: space: \x0a 8828: space: \x0a
8776: name: /Length 8831: name: /Length
8783: space: 8838: space:
8784: integer: 56 8839: integer: 56
8786: space: 8841: space:
8787: integer: 0 8842: integer: 0
8788: space: 8843: space:
8789: word: R 8844: word: R
8790: space: \x0a 8845: space: \x0a
8791: dict_close: >> 8846: dict_close: >>
8793: space: \x0a 8848: space: \x0a
8794: word: stream 8849: word: stream
skipping to endstream skipping to endstream
8845: word: endstream 8900: word: endstream
8854: space: \x0a 8909: space: \x0a
8855: word: endobj 8910: word: endobj
8861: space: \x0a\x0a 8916: space: \x0a\x0a
8863: integer: 56 8918: integer: 56
8865: space: 8920: space:
8866: integer: 0 8921: integer: 0
8867: space: 8922: space:
8868: word: obj 8923: word: obj
8871: space: \x0a 8926: space: \x0a
8872: integer: 44 8927: integer: 44
8874: space: \x0a 8929: space: \x0a
8875: word: endobj 8930: word: endobj
8881: space: \x0a\x0a 8936: space: \x0a\x0a
8883: comment: %% Contents for page 11 8938: comment: %% Contents for page 11
8906: space: \x0a 8961: space: \x0a
8907: comment: %% Original object ID: 47 0 8962: comment: %% Original object ID: 47 0
8934: space: \x0a 8989: space: \x0a
8935: integer: 57 8990: integer: 57
8937: space: 8992: space:
8938: integer: 0 8993: integer: 0
8939: space: 8994: space:
8940: word: obj 8995: word: obj
8943: space: \x0a 8998: space: \x0a
8944: dict_open: << 8999: dict_open: <<
8946: space: \x0a 9001: space: \x0a
8949: name: /Length 9004: name: /Length
8956: space: 9011: space:
8957: integer: 58 9012: integer: 58
8959: space: 9014: space:
8960: integer: 0 9015: integer: 0
8961: space: 9016: space:
8962: word: R 9017: word: R
8963: space: \x0a 9018: space: \x0a
8964: dict_close: >> 9019: dict_close: >>
8966: space: \x0a 9021: space: \x0a
8967: word: stream 9022: word: stream
skipping to endstream skipping to endstream
9018: word: endstream 9073: word: endstream
9027: space: \x0a 9082: space: \x0a
9028: word: endobj 9083: word: endobj
9034: space: \x0a\x0a 9089: space: \x0a\x0a
9036: integer: 58 9091: integer: 58
9038: space: 9093: space:
9039: integer: 0 9094: integer: 0
9040: space: 9095: space:
9041: word: obj 9096: word: obj
9044: space: \x0a 9099: space: \x0a
9045: integer: 44 9100: integer: 44
9047: space: \x0a 9102: space: \x0a
9048: word: endobj 9103: word: endobj
9054: space: \x0a\x0a 9109: space: \x0a\x0a
9056: integer: 59 9111: integer: 59
9058: space: 9113: space:
9059: integer: 0 9114: integer: 0
9060: space: 9115: space:
9061: word: obj 9116: word: obj
9064: space: \x0a 9119: space: \x0a
9065: dict_open: << 9120: dict_open: <<
9067: space: \x0a 9122: space: \x0a
9070: name: /Type 9125: name: /Type
9075: space: 9130: space:
9076: name: /XRef 9131: name: /XRef
9081: space: \x0a 9136: space: \x0a
9084: name: /Length 9139: name: /Length
9091: space: 9146: space:
9092: integer: 240 9147: integer: 240
9095: space: \x0a 9150: space: \x0a
9098: name: /W 9153: name: /W
9100: space: 9155: space:
9101: array_open: [ 9156: array_open: [
9102: space: 9157: space:
9103: integer: 1 9158: integer: 1
9104: space: 9159: space:
9105: integer: 2 9160: integer: 2
9106: space: 9161: space:
9107: integer: 1 9162: integer: 1
9108: space: 9163: space:
9109: array_close: ] 9164: array_close: ]
9110: space: \x0a 9165: space: \x0a
9113: name: /Root 9168: name: /Root
9118: space: 9173: space:
9119: integer: 2 9174: integer: 2
9120: space: 9175: space:
9121: integer: 0 9176: integer: 0
9122: space: 9177: space:
9123: word: R 9178: word: R
9124: space: \x0a 9179: space: \x0a
9127: name: /Size 9182: name: /Size
9132: space: 9187: space:
9133: integer: 60 9188: integer: 60
9135: space: \x0a 9190: space: \x0a
9138: name: /ID 9193: name: /ID
9141: space: 9196: space:
9142: array_open: [ 9197: array_open: [
9143: string: \x88\x04\x8e\x17\xc9a\xe0\x94\xff\xec\xe9\x8c\xb8\x8cF\xd0 (raw: <88048e17c961e094ffece98cb88c46d0>) 9198: string: \x88\x04\x8e\x17\xc9a\xe0\x94\xff\xec\xe9\x8c\xb8\x8cF\xd0 (raw: <88048e17c961e094ffece98cb88c46d0>)
9177: string: \xed\xd6\x0f\xe8\xee\x87\xf8\x871\xa8o\x81\x9f\xe6Q\x99 (raw: <edd60fe8ee87f88731a86f819fe65199>) 9232: string: \xed\xd6\x0f\xe8\xee\x87\xf8\x871\xa8o\x81\x9f\xe6Q\x99 (raw: <edd60fe8ee87f88731a86f819fe65199>)
9211: array_close: ] 9266: array_close: ]
9212: space: \x0a 9267: space: \x0a
9213: dict_close: >> 9268: dict_close: >>
9215: space: \x0a 9270: space: \x0a
9216: word: stream 9271: word: stream
skipping to endstream skipping to endstream
9464: word: endstream 9519: word: endstream
9473: space: \x0a 9528: space: \x0a
9474: word: endobj 9529: word: endobj
9480: space: \x0a\x0a 9535: space: \x0a\x0a
9482: word: startxref 9537: word: startxref
9491: space: \x0a 9546: space: \x0a
9492: integer: 9056 9547: integer: 9111
9496: space: \x0a 9551: space: \x0a
9497: comment: %%EOF 9552: comment: %%EOF
9502: space: \x0a 9557: space: \x0a
9503: eof 9558: eof
--- END FILE --- --- END FILE ---
--- BEGIN PAGE 1 --- --- BEGIN PAGE 1 ---
0: word: BT 0: word: BT
@ -669,69 +669,73 @@ skipping to endstream
117: space: \x0a 117: space: \x0a
120: string: qu\x0a\x0a\x0a\x0a\x0a\x0aack (raw: (qu\x0a\x0d\x0a\x0a\x0d\x0d\x0a\x0aack)) 120: string: qu\x0a\x0a\x0a\x0a\x0a\x0aack (raw: (qu\x0a\x0d\x0a\x0a\x0d\x0d\x0a\x0aack))
135: space: \x0a 135: space: \x0a
138: integer: 72 138: string: \x048!8Q\x04!Q\x04 (raw: (\48\418\121\4\41\121\4))
140: space: 162: space: \x0a
141: integer: 720 165: string: \x048!8Q\x04!Q! (raw: (\48\418\121\4\41\121\41))
144: space: 190: space: \x0a
145: word: Td 193: integer: 72
147: space: \x0a 195: space:
150: real: 3.14 196: integer: 720
154: space: \x0a 199: space:
157: real: 3. 200: word: Td
159: space: \x0a 202: space: \x0a
162: real: .14 205: real: 3.14
165: space: \x0a 209: space: \x0a
168: real: +3.14 212: real: 3.
173: space: \x0a 214: space: \x0a
176: real: +3. 217: real: .14
179: space: \x0a 220: space: \x0a
182: real: +.14 223: real: +3.14
186: space: \x0a 228: space: \x0a
189: real: -3.14 231: real: +3.
194: space: \x0a 234: space: \x0a
197: real: -3. 237: real: +.14
200: space: \x0a
203: real: -.14
207: space: \x0a
210: integer: +16059
216: space: \x0a
219: integer: -16059
225: space: \x0a
228: word: +.
230: space: \x0a
233: bad: <fade\x0aET (invalid character (T) in hexstring)
241: space: \x0a 241: space: \x0a
242: bad: ) (unexpected )) 244: real: -3.14
243: bad: > (unexpected >) 249: space: \x0a
244: word: quack 252: real: -3.
249: space: 255: space: \x0a
250: name: /name\x00oops (raw: /name#oops) (name with stray # will not work with PDF >= 1.2) 258: real: -.14
260: space: 262: space: \x0a
261: name: /name (raw: /n#61me) 265: integer: +16059
268: space: 271: space: \x0a
269: word: one 274: integer: -16059
272: space: 280: space: \x0a
273: bool: true 283: word: +.
277: space: 285: space: \x0a
278: word: two 288: bad: <fade\x0aET (invalid character (T) in hexstring)
281: space: 296: space: \x0a
282: bool: false 297: bad: ) (unexpected ))
287: space: 298: bad: > (unexpected >)
288: word: three 299: word: quack
293: space: 304: space:
294: null: null 305: name: /name\x00oops (raw: /name#oops) (name with stray # will not work with PDF >= 1.2)
298: space: 315: space:
299: word: four 316: name: /name (raw: /n#61me)
303: space: \x0a 323: space:
304: word: !@#$^& 324: word: one
310: brace_open: { 327: space:
311: brace_close: } 328: bool: true
312: word: *-_+= 332: space:
317: space: \x0a 333: word: two
318: word: abc123def3.14true 336: space:
335: space: \x0a 337: bool: false
336: bad: <ff\x0a (EOF while reading token) 342: space:
340: eof 343: word: three
348: space:
349: null: null
353: space:
354: word: four
358: space: \x0a
359: word: !@#$^&
365: brace_open: {
366: brace_close: }
367: word: *-_+=
372: space: \x0a
373: word: abc123def3.14true
390: space: \x0a
391: bad: <ff\x0a (EOF while reading token)
395: eof
--- END PAGE 4 --- --- END PAGE 4 ---
--- BEGIN PAGE 5 --- --- BEGIN PAGE 5 ---
0: word: BT 0: word: BT

View File

@ -81,172 +81,172 @@ skipping to endstream
7119: dict_close: >> 7119: dict_close: >>
7122: word: stream 7122: word: stream
skipping to endstream skipping to endstream
7469: word: endstream 7524: word: endstream
7479: word: endobj 7534: word: endobj
7487: integer: 44 7542: integer: 44
7490: integer: 0 7545: integer: 0
7492: word: obj 7547: word: obj
7496: integer: 340 7551: integer: 395
7500: word: endobj 7555: word: endobj
7559: integer: 45 7614: integer: 45
7562: integer: 0 7617: integer: 0
7564: word: obj 7619: word: obj
7568: dict_open: << 7623: dict_open: <<
7573: name: /Length 7628: name: /Length
7581: integer: 46 7636: integer: 46
7584: integer: 0 7639: integer: 0
7586: word: R 7641: word: R
7588: dict_close: >> 7643: dict_close: >>
7591: word: stream 7646: word: stream
skipping to endstream skipping to endstream
7666: word: endstream 7721: word: endstream
7676: word: endobj 7731: word: endobj
7705: integer: 46 7760: integer: 46
7708: integer: 0 7763: integer: 0
7710: word: obj 7765: word: obj
7714: integer: 67 7769: integer: 67
7717: word: endobj 7772: word: endobj
7776: integer: 47 7831: integer: 47
7779: integer: 0 7834: integer: 0
7781: word: obj 7836: word: obj
7785: dict_open: << 7840: dict_open: <<
7790: name: /Length 7845: name: /Length
7798: integer: 48 7853: integer: 48
7801: integer: 0 7856: integer: 0
7803: word: R 7858: word: R
7805: dict_close: >> 7860: dict_close: >>
7808: word: stream 7863: word: stream
skipping to endstream skipping to endstream
7859: word: endstream 7914: word: endstream
7869: word: endobj 7924: word: endobj
7877: integer: 48 7932: integer: 48
7880: integer: 0 7935: integer: 0
7882: word: obj 7937: word: obj
7886: integer: 44 7941: integer: 44
7889: word: endobj 7944: word: endobj
7948: integer: 49 8003: integer: 49
7951: integer: 0 8006: integer: 0
7953: word: obj 8008: word: obj
7957: dict_open: << 8012: dict_open: <<
7962: name: /Length 8017: name: /Length
7970: integer: 50 8025: integer: 50
7973: integer: 0 8028: integer: 0
7975: word: R 8030: word: R
7977: dict_close: >> 8032: dict_close: >>
7980: word: stream 8035: word: stream
skipping to endstream skipping to endstream
8306: word: endstream 8361: word: endstream
8316: word: endobj 8371: word: endobj
8345: integer: 50 8400: integer: 50
8348: integer: 0 8403: integer: 0
8350: word: obj 8405: word: obj
8354: integer: 318 8409: integer: 318
8358: word: endobj 8413: word: endobj
8417: integer: 51 8472: integer: 51
8420: integer: 0 8475: integer: 0
8422: word: obj 8477: word: obj
8426: dict_open: << 8481: dict_open: <<
8431: name: /Length 8486: name: /Length
8439: integer: 52 8494: integer: 52
8442: integer: 0 8497: integer: 0
8444: word: R 8499: word: R
8446: dict_close: >> 8501: dict_close: >>
8449: word: stream 8504: word: stream
skipping to endstream skipping to endstream
8500: word: endstream 8555: word: endstream
8510: word: endobj 8565: word: endobj
8518: integer: 52 8573: integer: 52
8521: integer: 0 8576: integer: 0
8523: word: obj 8578: word: obj
8527: integer: 44 8582: integer: 44
8530: word: endobj 8585: word: endobj
8589: integer: 53 8644: integer: 53
8592: integer: 0 8647: integer: 0
8594: word: obj 8649: word: obj
8598: dict_open: << 8653: dict_open: <<
8603: name: /Length 8658: name: /Length
8611: integer: 54 8666: integer: 54
8614: integer: 0 8669: integer: 0
8616: word: R 8671: word: R
8618: dict_close: >> 8673: dict_close: >>
8621: word: stream 8676: word: stream
skipping to endstream skipping to endstream
8672: word: endstream 8727: word: endstream
8682: word: endobj 8737: word: endobj
8690: integer: 54 8745: integer: 54
8693: integer: 0 8748: integer: 0
8695: word: obj 8750: word: obj
8699: integer: 44 8754: integer: 44
8702: word: endobj 8757: word: endobj
8762: integer: 55 8817: integer: 55
8765: integer: 0 8820: integer: 0
8767: word: obj 8822: word: obj
8771: dict_open: << 8826: dict_open: <<
8776: name: /Length 8831: name: /Length
8784: integer: 56 8839: integer: 56
8787: integer: 0 8842: integer: 0
8789: word: R 8844: word: R
8791: dict_close: >> 8846: dict_close: >>
8794: word: stream 8849: word: stream
skipping to endstream skipping to endstream
8845: word: endstream 8900: word: endstream
8855: word: endobj 8910: word: endobj
8863: integer: 56 8918: integer: 56
8866: integer: 0 8921: integer: 0
8868: word: obj 8923: word: obj
8872: integer: 44 8927: integer: 44
8875: word: endobj 8930: word: endobj
8935: integer: 57 8990: integer: 57
8938: integer: 0 8993: integer: 0
8940: word: obj 8995: word: obj
8944: dict_open: << 8999: dict_open: <<
8949: name: /Length 9004: name: /Length
8957: integer: 58 9012: integer: 58
8960: integer: 0 9015: integer: 0
8962: word: R 9017: word: R
8964: dict_close: >> 9019: dict_close: >>
8967: word: stream 9022: word: stream
skipping to endstream skipping to endstream
9018: word: endstream 9073: word: endstream
9028: word: endobj 9083: word: endobj
9036: integer: 58 9091: integer: 58
9039: integer: 0 9094: integer: 0
9041: word: obj 9096: word: obj
9045: integer: 44 9100: integer: 44
9048: word: endobj 9103: word: endobj
9056: integer: 59 9111: integer: 59
9059: integer: 0 9114: integer: 0
9061: word: obj 9116: word: obj
9065: dict_open: << 9120: dict_open: <<
9070: name: /Type 9125: name: /Type
9076: name: /XRef 9131: name: /XRef
9084: name: /Length 9139: name: /Length
9092: integer: 240 9147: integer: 240
9098: name: /W 9153: name: /W
9101: array_open: [ 9156: array_open: [
9103: integer: 1 9158: integer: 1
9105: integer: 2 9160: integer: 2
9107: integer: 1 9162: integer: 1
9109: array_close: ] 9164: array_close: ]
9113: name: /Root 9168: name: /Root
9119: integer: 2 9174: integer: 2
9121: integer: 0 9176: integer: 0
9123: word: R 9178: word: R
9127: name: /Size 9182: name: /Size
9133: integer: 60 9188: integer: 60
9138: name: /ID 9193: name: /ID
9142: array_open: [ 9197: array_open: [
9143: string: \x88\x04\x8e\x17\xc9a\xe0\x94\xff\xec\xe9\x8c\xb8\x8cF\xd0 (raw: <88048e17c961e094ffece98cb88c46d0>) 9198: string: \x88\x04\x8e\x17\xc9a\xe0\x94\xff\xec\xe9\x8c\xb8\x8cF\xd0 (raw: <88048e17c961e094ffece98cb88c46d0>)
9177: string: \xed\xd6\x0f\xe8\xee\x87\xf8\x871\xa8o\x81\x9f\xe6Q\x99 (raw: <edd60fe8ee87f88731a86f819fe65199>) 9232: string: \xed\xd6\x0f\xe8\xee\x87\xf8\x871\xa8o\x81\x9f\xe6Q\x99 (raw: <edd60fe8ee87f88731a86f819fe65199>)
9211: array_close: ] 9266: array_close: ]
9213: dict_close: >> 9268: dict_close: >>
9216: word: stream 9271: word: stream
skipping to endstream skipping to endstream
9464: word: endstream 9519: word: endstream
9474: word: endobj 9529: word: endobj
9482: word: startxref 9537: word: startxref
9492: integer: 9056 9547: integer: 9111
9503: eof 9558: eof
--- END FILE --- --- END FILE ---
--- BEGIN PAGE 1 --- --- BEGIN PAGE 1 ---
0: word: BT 0: word: BT
@ -330,41 +330,43 @@ skipping to endstream
87: string: qu\x0aack (raw: (qu\\x0d\x0dack)) 87: string: qu\x0aack (raw: (qu\\x0d\x0dack))
100: string: qu\x0a\x0a\x0a\x0a\x0a\x0aack (raw: (qu\\x0a\x0a\x0d\x0a\x0a\x0d\x0d\x0a\x0aack)) 100: string: qu\x0a\x0a\x0a\x0a\x0a\x0aack (raw: (qu\\x0a\x0a\x0d\x0a\x0a\x0d\x0d\x0a\x0aack))
120: string: qu\x0a\x0a\x0a\x0a\x0a\x0aack (raw: (qu\x0a\x0d\x0a\x0a\x0d\x0d\x0a\x0aack)) 120: string: qu\x0a\x0a\x0a\x0a\x0a\x0aack (raw: (qu\x0a\x0d\x0a\x0a\x0d\x0d\x0a\x0aack))
138: integer: 72 138: string: \x048!8Q\x04!Q\x04 (raw: (\48\418\121\4\41\121\4))
141: integer: 720 165: string: \x048!8Q\x04!Q! (raw: (\48\418\121\4\41\121\41))
145: word: Td 193: integer: 72
150: real: 3.14 196: integer: 720
157: real: 3. 200: word: Td
162: real: .14 205: real: 3.14
168: real: +3.14 212: real: 3.
176: real: +3. 217: real: .14
182: real: +.14 223: real: +3.14
189: real: -3.14 231: real: +3.
197: real: -3. 237: real: +.14
203: real: -.14 244: real: -3.14
210: integer: +16059 252: real: -3.
219: integer: -16059 258: real: -.14
228: word: +. 265: integer: +16059
233: bad: <fade\x0aET (invalid character (T) in hexstring) 274: integer: -16059
242: bad: ) (unexpected )) 283: word: +.
243: bad: > (unexpected >) 288: bad: <fade\x0aET (invalid character (T) in hexstring)
244: word: quack 297: bad: ) (unexpected ))
250: name: /name\x00oops (raw: /name#oops) (name with stray # will not work with PDF >= 1.2) 298: bad: > (unexpected >)
261: name: /name (raw: /n#61me) 299: word: quack
269: word: one 305: name: /name\x00oops (raw: /name#oops) (name with stray # will not work with PDF >= 1.2)
273: bool: true 316: name: /name (raw: /n#61me)
278: word: two 324: word: one
282: bool: false 328: bool: true
288: word: three 333: word: two
294: null: null 337: bool: false
299: word: four 343: word: three
304: word: !@#$^& 349: null: null
310: brace_open: { 354: word: four
311: brace_close: } 359: word: !@#$^&
312: word: *-_+= 365: brace_open: {
318: word: abc123def3.14true 366: brace_close: }
336: bad: <ff\x0a (EOF while reading token) 367: word: *-_+=
340: eof 373: word: abc123def3.14true
391: bad: <ff\x0a (EOF while reading token)
395: eof
--- END PAGE 4 --- --- END PAGE 4 ---
--- BEGIN PAGE 5 --- --- BEGIN PAGE 5 ---
0: word: BT 0: word: BT

View File

@ -181,352 +181,352 @@ skipping to endstream
7121: space: \x0a 7121: space: \x0a
7122: word: stream 7122: word: stream
skipping to endstream skipping to endstream
7469: word: endstream 7524: word: endstream
7478: space: \x0a 7533: space: \x0a
7479: word: endobj 7534: word: endobj
7485: space: \x0a\x0a 7540: space: \x0a\x0a
7487: integer: 44 7542: integer: 44
7489: space: 7544: space:
7490: integer: 0 7545: integer: 0
7491: space: 7546: space:
7492: word: obj 7547: word: obj
7495: space: \x0a 7550: space: \x0a
7496: integer: 340 7551: integer: 395
7499: space: \x0a 7554: space: \x0a
7500: word: endobj 7555: word: endobj
7506: space: \x0a\x0a 7561: space: \x0a\x0a
7508: comment: %% Contents for page 5 7563: comment: %% Contents for page 5
7530: space: \x0a 7585: space: \x0a
7531: comment: %% Original object ID: 41 0 7586: comment: %% Original object ID: 41 0
7558: space: \x0a 7613: space: \x0a
7559: integer: 45 7614: integer: 45
7561: space: 7616: space:
7562: integer: 0 7617: integer: 0
7563: space: 7618: space:
7564: word: obj 7619: word: obj
7567: space: \x0a 7622: space: \x0a
7568: dict_open: << 7623: dict_open: <<
7570: space: \x0a 7625: space: \x0a
7573: name: /Length 7628: name: /Length
7580: space: 7635: space:
7581: integer: 46 7636: integer: 46
7583: space: 7638: space:
7584: integer: 0 7639: integer: 0
7585: space: 7640: space:
7586: word: R 7641: word: R
7587: space: \x0a 7642: space: \x0a
7588: dict_close: >> 7643: dict_close: >>
7590: space: \x0a 7645: space: \x0a
7591: word: stream 7646: word: stream
skipping to endstream skipping to endstream
7666: word: endstream 7721: word: endstream
7675: space: \x0a 7730: space: \x0a
7676: word: endobj 7731: word: endobj
7682: space: \x0a 7737: space: \x0a
7683: comment: %QDF: ignore_newline 7738: comment: %QDF: ignore_newline
7703: space: \x0a\x0a 7758: space: \x0a\x0a
7705: integer: 46 7760: integer: 46
7707: space: 7762: space:
7708: integer: 0 7763: integer: 0
7709: space: 7764: space:
7710: word: obj 7765: word: obj
7713: space: \x0a 7768: space: \x0a
7714: integer: 67 7769: integer: 67
7716: space: \x0a 7771: space: \x0a
7717: word: endobj 7772: word: endobj
7723: space: \x0a\x0a 7778: space: \x0a\x0a
7725: comment: %% Contents for page 6 7780: comment: %% Contents for page 6
7747: space: \x0a 7802: space: \x0a
7748: comment: %% Original object ID: 42 0 7803: comment: %% Original object ID: 42 0
7775: space: \x0a 7830: space: \x0a
7776: integer: 47 7831: integer: 47
7778: space: 7833: space:
7779: integer: 0 7834: integer: 0
7780: space: 7835: space:
7781: word: obj 7836: word: obj
7784: space: \x0a 7839: space: \x0a
7785: dict_open: << 7840: dict_open: <<
7787: space: \x0a 7842: space: \x0a
7790: name: /Length 7845: name: /Length
7797: space: 7852: space:
7798: integer: 48 7853: integer: 48
7800: space: 7855: space:
7801: integer: 0 7856: integer: 0
7802: space: 7857: space:
7803: word: R 7858: word: R
7804: space: \x0a 7859: space: \x0a
7805: dict_close: >> 7860: dict_close: >>
7807: space: \x0a 7862: space: \x0a
7808: word: stream 7863: word: stream
skipping to endstream skipping to endstream
7859: word: endstream 7914: word: endstream
7868: space: \x0a 7923: space: \x0a
7869: word: endobj 7924: word: endobj
7875: space: \x0a\x0a 7930: space: \x0a\x0a
7877: integer: 48 7932: integer: 48
7879: space: 7934: space:
7880: integer: 0 7935: integer: 0
7881: space: 7936: space:
7882: word: obj 7937: word: obj
7885: space: \x0a 7940: space: \x0a
7886: integer: 44 7941: integer: 44
7888: space: \x0a 7943: space: \x0a
7889: word: endobj 7944: word: endobj
7895: space: \x0a\x0a 7950: space: \x0a\x0a
7897: comment: %% Contents for page 7 7952: comment: %% Contents for page 7
7919: space: \x0a 7974: space: \x0a
7920: comment: %% Original object ID: 43 0 7975: comment: %% Original object ID: 43 0
7947: space: \x0a 8002: space: \x0a
7948: integer: 49 8003: integer: 49
7950: space: 8005: space:
7951: integer: 0 8006: integer: 0
7952: space: 8007: space:
7953: word: obj 8008: word: obj
7956: space: \x0a 8011: space: \x0a
7957: dict_open: << 8012: dict_open: <<
7959: space: \x0a 8014: space: \x0a
7962: name: /Length 8017: name: /Length
7969: space: 8024: space:
7970: integer: 50 8025: integer: 50
7972: space: 8027: space:
7973: integer: 0 8028: integer: 0
7974: space: 8029: space:
7975: word: R 8030: word: R
7976: space: \x0a 8031: space: \x0a
7977: dict_close: >> 8032: dict_close: >>
7979: space: \x0a 8034: space: \x0a
7980: word: stream 8035: word: stream
skipping to endstream skipping to endstream
8306: word: endstream 8361: word: endstream
8315: space: \x0a 8370: space: \x0a
8316: word: endobj 8371: word: endobj
8322: space: \x0a 8377: space: \x0a
8323: comment: %QDF: ignore_newline 8378: comment: %QDF: ignore_newline
8343: space: \x0a\x0a 8398: space: \x0a\x0a
8345: integer: 50 8400: integer: 50
8347: space: 8402: space:
8348: integer: 0 8403: integer: 0
8349: space: 8404: space:
8350: word: obj 8405: word: obj
8353: space: \x0a 8408: space: \x0a
8354: integer: 318 8409: integer: 318
8357: space: \x0a 8412: space: \x0a
8358: word: endobj 8413: word: endobj
8364: space: \x0a\x0a 8419: space: \x0a\x0a
8366: comment: %% Contents for page 8 8421: comment: %% Contents for page 8
8388: space: \x0a 8443: space: \x0a
8389: comment: %% Original object ID: 44 0 8444: comment: %% Original object ID: 44 0
8416: space: \x0a 8471: space: \x0a
8417: integer: 51 8472: integer: 51
8419: space: 8474: space:
8420: integer: 0 8475: integer: 0
8421: space: 8476: space:
8422: word: obj 8477: word: obj
8425: space: \x0a 8480: space: \x0a
8426: dict_open: << 8481: dict_open: <<
8428: space: \x0a 8483: space: \x0a
8431: name: /Length 8486: name: /Length
8438: space: 8493: space:
8439: integer: 52 8494: integer: 52
8441: space: 8496: space:
8442: integer: 0 8497: integer: 0
8443: space: 8498: space:
8444: word: R 8499: word: R
8445: space: \x0a 8500: space: \x0a
8446: dict_close: >> 8501: dict_close: >>
8448: space: \x0a 8503: space: \x0a
8449: word: stream 8504: word: stream
skipping to endstream skipping to endstream
8500: word: endstream 8555: word: endstream
8509: space: \x0a 8564: space: \x0a
8510: word: endobj 8565: word: endobj
8516: space: \x0a\x0a 8571: space: \x0a\x0a
8518: integer: 52 8573: integer: 52
8520: space: 8575: space:
8521: integer: 0 8576: integer: 0
8522: space: 8577: space:
8523: word: obj 8578: word: obj
8526: space: \x0a 8581: space: \x0a
8527: integer: 44 8582: integer: 44
8529: space: \x0a 8584: space: \x0a
8530: word: endobj 8585: word: endobj
8536: space: \x0a\x0a 8591: space: \x0a\x0a
8538: comment: %% Contents for page 9 8593: comment: %% Contents for page 9
8560: space: \x0a 8615: space: \x0a
8561: comment: %% Original object ID: 45 0 8616: comment: %% Original object ID: 45 0
8588: space: \x0a 8643: space: \x0a
8589: integer: 53 8644: integer: 53
8591: space: 8646: space:
8592: integer: 0 8647: integer: 0
8593: space: 8648: space:
8594: word: obj 8649: word: obj
8597: space: \x0a 8652: space: \x0a
8598: dict_open: << 8653: dict_open: <<
8600: space: \x0a 8655: space: \x0a
8603: name: /Length 8658: name: /Length
8610: space: 8665: space:
8611: integer: 54 8666: integer: 54
8613: space: 8668: space:
8614: integer: 0 8669: integer: 0
8615: space: 8670: space:
8616: word: R 8671: word: R
8617: space: \x0a 8672: space: \x0a
8618: dict_close: >> 8673: dict_close: >>
8620: space: \x0a 8675: space: \x0a
8621: word: stream 8676: word: stream
skipping to endstream skipping to endstream
8672: word: endstream 8727: word: endstream
8681: space: \x0a 8736: space: \x0a
8682: word: endobj 8737: word: endobj
8688: space: \x0a\x0a 8743: space: \x0a\x0a
8690: integer: 54 8745: integer: 54
8692: space: 8747: space:
8693: integer: 0 8748: integer: 0
8694: space: 8749: space:
8695: word: obj 8750: word: obj
8698: space: \x0a 8753: space: \x0a
8699: integer: 44 8754: integer: 44
8701: space: \x0a 8756: space: \x0a
8702: word: endobj 8757: word: endobj
8708: space: \x0a\x0a 8763: space: \x0a\x0a
8710: comment: %% Contents for page 10 8765: comment: %% Contents for page 10
8733: space: \x0a 8788: space: \x0a
8734: comment: %% Original object ID: 46 0 8789: comment: %% Original object ID: 46 0
8761: space: \x0a 8816: space: \x0a
8762: integer: 55 8817: integer: 55
8764: space: 8819: space:
8765: integer: 0 8820: integer: 0
8766: space: 8821: space:
8767: word: obj 8822: word: obj
8770: space: \x0a 8825: space: \x0a
8771: dict_open: << 8826: dict_open: <<
8773: space: \x0a 8828: space: \x0a
8776: name: /Length 8831: name: /Length
8783: space: 8838: space:
8784: integer: 56 8839: integer: 56
8786: space: 8841: space:
8787: integer: 0 8842: integer: 0
8788: space: 8843: space:
8789: word: R 8844: word: R
8790: space: \x0a 8845: space: \x0a
8791: dict_close: >> 8846: dict_close: >>
8793: space: \x0a 8848: space: \x0a
8794: word: stream 8849: word: stream
skipping to endstream skipping to endstream
8845: word: endstream 8900: word: endstream
8854: space: \x0a 8909: space: \x0a
8855: word: endobj 8910: word: endobj
8861: space: \x0a\x0a 8916: space: \x0a\x0a
8863: integer: 56 8918: integer: 56
8865: space: 8920: space:
8866: integer: 0 8921: integer: 0
8867: space: 8922: space:
8868: word: obj 8923: word: obj
8871: space: \x0a 8926: space: \x0a
8872: integer: 44 8927: integer: 44
8874: space: \x0a 8929: space: \x0a
8875: word: endobj 8930: word: endobj
8881: space: \x0a\x0a 8936: space: \x0a\x0a
8883: comment: %% Contents for page 11 8938: comment: %% Contents for page 11
8906: space: \x0a 8961: space: \x0a
8907: comment: %% Original object ID: 47 0 8962: comment: %% Original object ID: 47 0
8934: space: \x0a 8989: space: \x0a
8935: integer: 57 8990: integer: 57
8937: space: 8992: space:
8938: integer: 0 8993: integer: 0
8939: space: 8994: space:
8940: word: obj 8995: word: obj
8943: space: \x0a 8998: space: \x0a
8944: dict_open: << 8999: dict_open: <<
8946: space: \x0a 9001: space: \x0a
8949: name: /Length 9004: name: /Length
8956: space: 9011: space:
8957: integer: 58 9012: integer: 58
8959: space: 9014: space:
8960: integer: 0 9015: integer: 0
8961: space: 9016: space:
8962: word: R 9017: word: R
8963: space: \x0a 9018: space: \x0a
8964: dict_close: >> 9019: dict_close: >>
8966: space: \x0a 9021: space: \x0a
8967: word: stream 9022: word: stream
skipping to endstream skipping to endstream
9018: word: endstream 9073: word: endstream
9027: space: \x0a 9082: space: \x0a
9028: word: endobj 9083: word: endobj
9034: space: \x0a\x0a 9089: space: \x0a\x0a
9036: integer: 58 9091: integer: 58
9038: space: 9093: space:
9039: integer: 0 9094: integer: 0
9040: space: 9095: space:
9041: word: obj 9096: word: obj
9044: space: \x0a 9099: space: \x0a
9045: integer: 44 9100: integer: 44
9047: space: \x0a 9102: space: \x0a
9048: word: endobj 9103: word: endobj
9054: space: \x0a\x0a 9109: space: \x0a\x0a
9056: integer: 59 9111: integer: 59
9058: space: 9113: space:
9059: integer: 0 9114: integer: 0
9060: space: 9115: space:
9061: word: obj 9116: word: obj
9064: space: \x0a 9119: space: \x0a
9065: dict_open: << 9120: dict_open: <<
9067: space: \x0a 9122: space: \x0a
9070: name: /Type 9125: name: /Type
9075: space: 9130: space:
9076: name: /XRef 9131: name: /XRef
9081: space: \x0a 9136: space: \x0a
9084: name: /Length 9139: name: /Length
9091: space: 9146: space:
9092: integer: 240 9147: integer: 240
9095: space: \x0a 9150: space: \x0a
9098: name: /W 9153: name: /W
9100: space: 9155: space:
9101: array_open: [ 9156: array_open: [
9102: space: 9157: space:
9103: integer: 1 9158: integer: 1
9104: space: 9159: space:
9105: integer: 2 9160: integer: 2
9106: space: 9161: space:
9107: integer: 1 9162: integer: 1
9108: space: 9163: space:
9109: array_close: ] 9164: array_close: ]
9110: space: \x0a 9165: space: \x0a
9113: name: /Root 9168: name: /Root
9118: space: 9173: space:
9119: integer: 2 9174: integer: 2
9120: space: 9175: space:
9121: integer: 0 9176: integer: 0
9122: space: 9177: space:
9123: word: R 9178: word: R
9124: space: \x0a 9179: space: \x0a
9127: name: /Size 9182: name: /Size
9132: space: 9187: space:
9133: integer: 60 9188: integer: 60
9135: space: \x0a 9190: space: \x0a
9138: name: /ID 9193: name: /ID
9141: space: 9196: space:
9142: array_open: [ 9197: array_open: [
9143: string: \x88\x04\x8e\x17\xc9a\xe0\x94\xff\xec\xe9\x8c\xb8\x8cF\xd0 (raw: <88048e17c961e094ffece98cb88c46d0>) 9198: string: \x88\x04\x8e\x17\xc9a\xe0\x94\xff\xec\xe9\x8c\xb8\x8cF\xd0 (raw: <88048e17c961e094ffece98cb88c46d0>)
9177: string: \xed\xd6\x0f\xe8\xee\x87\xf8\x871\xa8o\x81\x9f\xe6Q\x99 (raw: <edd60fe8ee87f88731a86f819fe65199>) 9232: string: \xed\xd6\x0f\xe8\xee\x87\xf8\x871\xa8o\x81\x9f\xe6Q\x99 (raw: <edd60fe8ee87f88731a86f819fe65199>)
9211: array_close: ] 9266: array_close: ]
9212: space: \x0a 9267: space: \x0a
9213: dict_close: >> 9268: dict_close: >>
9215: space: \x0a 9270: space: \x0a
9216: word: stream 9271: word: stream
skipping to endstream skipping to endstream
9464: word: endstream 9519: word: endstream
9473: space: \x0a 9528: space: \x0a
9474: word: endobj 9529: word: endobj
9480: space: \x0a\x0a 9535: space: \x0a\x0a
9482: word: startxref 9537: word: startxref
9491: space: \x0a 9546: space: \x0a
9492: integer: 9056 9547: integer: 9111
9496: space: \x0a 9551: space: \x0a
9497: comment: %%EOF 9552: comment: %%EOF
9502: space: \x0a 9557: space: \x0a
9503: eof 9558: eof
--- END FILE --- --- END FILE ---
--- BEGIN PAGE 1 --- --- BEGIN PAGE 1 ---
0: word: BT 0: word: BT
@ -669,69 +669,73 @@ skipping to endstream
117: space: \x0a 117: space: \x0a
120: string: qu\x0a\x0a\x0a\x0a\x0a\x0aack (raw: (qu\x0a\x0d\x0a\x0a\x0d\x0d\x0a\x0aack)) 120: string: qu\x0a\x0a\x0a\x0a\x0a\x0aack (raw: (qu\x0a\x0d\x0a\x0a\x0d\x0d\x0a\x0aack))
135: space: \x0a 135: space: \x0a
138: integer: 72 138: string: \x048!8Q\x04!Q\x04 (raw: (\48\418\121\4\41\121\4))
140: space: 162: space: \x0a
141: integer: 720 165: string: \x048!8Q\x04!Q! (raw: (\48\418\121\4\41\121\41))
144: space: 190: space: \x0a
145: word: Td 193: integer: 72
147: space: \x0a 195: space:
150: real: 3.14 196: integer: 720
154: space: \x0a 199: space:
157: real: 3. 200: word: Td
159: space: \x0a 202: space: \x0a
162: real: .14 205: real: 3.14
165: space: \x0a 209: space: \x0a
168: real: +3.14 212: real: 3.
173: space: \x0a 214: space: \x0a
176: real: +3. 217: real: .14
179: space: \x0a 220: space: \x0a
182: real: +.14 223: real: +3.14
186: space: \x0a 228: space: \x0a
189: real: -3.14 231: real: +3.
194: space: \x0a 234: space: \x0a
197: real: -3. 237: real: +.14
200: space: \x0a
203: real: -.14
207: space: \x0a
210: integer: +16059
216: space: \x0a
219: integer: -16059
225: space: \x0a
228: word: +.
230: space: \x0a
233: bad: <fade\x0aET (invalid character (T) in hexstring)
241: space: \x0a 241: space: \x0a
242: bad: ) (unexpected )) 244: real: -3.14
243: bad: > (unexpected >) 249: space: \x0a
244: word: quack 252: real: -3.
249: space: 255: space: \x0a
250: name: /name\x00oops (raw: /name#oops) (name with stray # will not work with PDF >= 1.2) 258: real: -.14
260: space: 262: space: \x0a
261: name: /name (raw: /n#61me) 265: integer: +16059
268: space: 271: space: \x0a
269: word: one 274: integer: -16059
272: space: 280: space: \x0a
273: bool: true 283: word: +.
277: space: 285: space: \x0a
278: word: two 288: bad: <fade\x0aET (invalid character (T) in hexstring)
281: space: 296: space: \x0a
282: bool: false 297: bad: ) (unexpected ))
287: space: 298: bad: > (unexpected >)
288: word: three 299: word: quack
293: space: 304: space:
294: null: null 305: name: /name\x00oops (raw: /name#oops) (name with stray # will not work with PDF >= 1.2)
298: space: 315: space:
299: word: four 316: name: /name (raw: /n#61me)
303: space: \x0a 323: space:
304: word: !@#$^& 324: word: one
310: brace_open: { 327: space:
311: brace_close: } 328: bool: true
312: word: *-_+= 332: space:
317: space: \x0a 333: word: two
318: word: abc123def3.14true 336: space:
335: space: \x0a 337: bool: false
336: bad: <ff\x0a (EOF while reading token) 342: space:
340: eof 343: word: three
348: space:
349: null: null
353: space:
354: word: four
358: space: \x0a
359: word: !@#$^&
365: brace_open: {
366: brace_close: }
367: word: *-_+=
372: space: \x0a
373: word: abc123def3.14true
390: space: \x0a
391: bad: <ff\x0a (EOF while reading token)
395: eof
--- END PAGE 4 --- --- END PAGE 4 ---
--- BEGIN PAGE 5 --- --- BEGIN PAGE 5 ---
0: word: BT 0: word: BT

Binary file not shown.

View File

@ -14,7 +14,7 @@ cleanup();
my $td = new TestDriver('tokenizer'); my $td = new TestDriver('tokenizer');
my $n_tests = 4; my $n_tests = 5;
$td->runtest("tokenizer with no ignorable", $td->runtest("tokenizer with no ignorable",
{$td->COMMAND => "test_tokenizer -no-ignorable tokens.pdf"}, {$td->COMMAND => "test_tokenizer -no-ignorable tokens.pdf"},
@ -38,5 +38,11 @@ $td->runtest("ignore bad token",
$td->EXIT_STATUS => 0}, $td->EXIT_STATUS => 0},
$td->NORMALIZE_NEWLINES); $td->NORMALIZE_NEWLINES);
$td->runtest("quoted char edge cases",
{$td->COMMAND => "test_driver 96 -"},
{$td->STRING => "test 96 done\n",
$td->EXIT_STATUS => 0},
$td->NORMALIZE_NEWLINES);
cleanup(); cleanup();
$td->report($n_tests); $td->report($n_tests);

View File

@ -3341,6 +3341,17 @@ test_95(QPDF& pdf, char const* arg2)
assert(!oh_d.isScalar()); assert(!oh_d.isScalar());
} }
static void
test_96(QPDF& pdf, char const* arg2)
{
// Test edge cases with quoted characters
auto s = R"((\48\418\121\4))"_qpdf;
assert(s.unparseBinary() == "<043821385104>");
s = R"((\48\418\121\41))"_qpdf;
assert(s.unparseBinary() == "<043821385121>");
}
void void
runtest(int n, char const* filename1, char const* arg2) runtest(int n, char const* filename1, char const* arg2)
{ {
@ -3348,7 +3359,7 @@ runtest(int n, char const* filename1, char const* arg2)
// the test suite to see how the test is invoked to find the file // the test suite to see how the test is invoked to find the file
// that the test is supposed to operate on. // that the test is supposed to operate on.
std::set<int> ignore_filename = {61, 81, 83, 84, 85, 86, 87, 92, 95}; std::set<int> ignore_filename = {61, 81, 83, 84, 85, 86, 87, 92, 95, 96};
if (n == 0) { if (n == 0) {
// Throw in some random test cases that don't fit anywhere // Throw in some random test cases that don't fit anywhere
@ -3441,7 +3452,8 @@ runtest(int n, char const* filename1, char const* arg2)
{72, test_72}, {73, test_73}, {74, test_74}, {75, test_75}, {76, test_76}, {77, test_77}, {72, test_72}, {73, test_73}, {74, test_74}, {75, test_75}, {76, test_76}, {77, test_77},
{78, test_78}, {79, test_79}, {80, test_80}, {81, test_81}, {82, test_82}, {83, test_83}, {78, test_78}, {79, test_79}, {80, test_80}, {81, test_81}, {82, test_82}, {83, test_83},
{84, test_84}, {85, test_85}, {86, test_86}, {87, test_87}, {88, test_88}, {89, test_89}, {84, test_84}, {85, test_85}, {86, test_86}, {87, test_87}, {88, test_88}, {89, test_89},
{90, test_90}, {91, test_91}, {92, test_92}, {93, test_93}, {94, test_94}, {95, test_95}}; {90, test_90}, {91, test_91}, {92, test_92}, {93, test_93}, {94, test_94}, {95, test_95},
{96, test_96}};
auto fn = test_functions.find(n); auto fn = test_functions.find(n);
if (fn == test_functions.end()) { if (fn == test_functions.end()) {