1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:17:35 +00:00

LibPDF: Parse linearized PDF files

This is a big step, as most PDFs which are downloaded online will be
linearized. Pretty much the only difference is that the xref structure
is slightly different.
This commit is contained in:
Matthew Olsson 2021-05-26 22:52:05 -07:00 committed by Ali Mohammad Pur
parent be1be47613
commit e23bfd7252
8 changed files with 270 additions and 45 deletions

View file

@ -48,11 +48,12 @@ public:
}
}
char read()
template<typename T = char>
T read()
{
auto value = m_bytes.at(m_offset);
move_by(1);
return static_cast<char>(value);
T value = reinterpret_cast<const T*>(m_bytes.offset(m_offset))[0];
move_by(sizeof(T));
return value;
}
char peek(size_t shift = 0) const