mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 11:47:45 +00:00
LibPDF: Allow newlines between xref table and "trailer" keyword
This commit is contained in:
parent
4d509ff365
commit
6133acb8c0
1 changed files with 7 additions and 2 deletions
|
@ -303,7 +303,7 @@ PDFErrorOr<NonnullRefPtr<XRefTable>> Parser::parse_xref_table()
|
||||||
|
|
||||||
auto table = adopt_ref(*new XRefTable());
|
auto table = adopt_ref(*new XRefTable());
|
||||||
|
|
||||||
while (true) {
|
do {
|
||||||
if (m_reader.matches("trailer"))
|
if (m_reader.matches("trailer"))
|
||||||
return table;
|
return table;
|
||||||
|
|
||||||
|
@ -349,11 +349,16 @@ PDFErrorOr<NonnullRefPtr<XRefTable>> Parser::parse_xref_table()
|
||||||
}
|
}
|
||||||
|
|
||||||
table->add_section({ starting_index, object_count, entries });
|
table->add_section({ starting_index, object_count, entries });
|
||||||
}
|
} while (matches_number());
|
||||||
|
|
||||||
|
return table;
|
||||||
}
|
}
|
||||||
|
|
||||||
PDFErrorOr<NonnullRefPtr<DictObject>> Parser::parse_file_trailer()
|
PDFErrorOr<NonnullRefPtr<DictObject>> Parser::parse_file_trailer()
|
||||||
{
|
{
|
||||||
|
while (matches_eol())
|
||||||
|
consume_eol();
|
||||||
|
|
||||||
if (!m_reader.matches("trailer"))
|
if (!m_reader.matches("trailer"))
|
||||||
return error("Expected \"trailer\" keyword");
|
return error("Expected \"trailer\" keyword");
|
||||||
m_reader.move_by(7);
|
m_reader.move_by(7);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue