mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:57: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:
parent
be1be47613
commit
e23bfd7252
8 changed files with 270 additions and 45 deletions
|
@ -109,6 +109,22 @@ public:
|
|||
return m_as_int;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
[[nodiscard]] ALWAYS_INLINE bool is_int_type() const
|
||||
{
|
||||
if (!is_int())
|
||||
return false;
|
||||
auto as_int = static_cast<T>(m_as_int);
|
||||
return as_int >= NumericLimits<T>::min() && as_int <= NumericLimits<T>::max();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
[[nodiscard]] ALWAYS_INLINE T as_int_type() const
|
||||
{
|
||||
VERIFY(is_int_type<T>());
|
||||
return static_cast<T>(m_as_int);
|
||||
}
|
||||
|
||||
[[nodiscard]] ALWAYS_INLINE int to_int() const
|
||||
{
|
||||
if (is_int())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue