mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Support an odd number of digits in hexadecimal strings (issue 18645)
See https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf#G6.1840792
This commit is contained in:
parent
908f453384
commit
8728f7f134
5 changed files with 28 additions and 20 deletions
|
@ -201,11 +201,12 @@ describe("parser", function () {
|
|||
});
|
||||
|
||||
describe("getHexString", function () {
|
||||
it("should not throw exception on bad input", function () {
|
||||
// '7 0 2 15 5 2 2 2 4 3 2 4' should be parsed as '70 21 55 22 24 32'.
|
||||
it("should handle an odd number of digits", function () {
|
||||
// '7 0 2 15 5 2 2 2 4 3 2 4' should be parsed as
|
||||
// '70 21 55 22 24 32 40'.
|
||||
const input = new StringStream("<7 0 2 15 5 2 2 2 4 3 2 4>");
|
||||
const lexer = new Lexer(input);
|
||||
expect(lexer.getHexString()).toEqual('p!U"$2');
|
||||
expect(lexer.getHexString()).toEqual('p!U"$2@');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue