diff options
author | Matthew Olsson <matthewcolsson@gmail.com> | 2021-05-08 14:57:49 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-10 10:32:39 +0200 |
commit | 8c745ad0d9198db1cd078dff573353457294a840 (patch) | |
tree | 05cd0e85a7b49e3e6d57bdd71ae7f97c8bd823be /Meta/CMake | |
parent | 72f693e9ed6b106e0760a3b1869f92d3267ddd41 (diff) | |
download | serenity-8c745ad0d9198db1cd078dff573353457294a840.zip |
LibPDF: Parse page structures
This commit introduces the ability to parse the document catalog dict,
as well as the page tree and individual pages. Pages obviously aren't
fully parsed, as we won't care about most of the fields until we
start actually rendering PDFs.
One of the primary benefits of the PDF format is laziness. PDFs are
not meant to be parsed all at once, and the same is true for pages.
When a Document is constructed, it builds a map of page number to
object index, but it does not fetch and parse any of the pages. A page
is only parsed when a caller requests that particular page (and is
cached going forwards).
Additionally, this commit also adds an object_cast function which
logs bad casts if DEBUG_PDF is set. Additionally, utility functions
were added to ArrayObject and DictObject to get all types of objects
from the collections to avoid having to manually cast.
Diffstat (limited to 'Meta/CMake')
-rw-r--r-- | Meta/CMake/all_the_debug_macros.cmake | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Meta/CMake/all_the_debug_macros.cmake b/Meta/CMake/all_the_debug_macros.cmake index 1f11e383d8..fd5c5f909a 100644 --- a/Meta/CMake/all_the_debug_macros.cmake +++ b/Meta/CMake/all_the_debug_macros.cmake @@ -176,6 +176,7 @@ set(LINE_EDITOR_DEBUG ON) set(LANGUAGE_SERVER_DEBUG ON) set(GL_DEBUG ON) set(WASM_BINPARSER_DEBUG ON) +set(PDF_DEBUG ON) # False positive: DEBUG is a flag but it works differently. # set(DEBUG ON) |