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

LibPDF: Parse nested Page Tree structures

We now follow nested page tree nodes to find all of the actual
page dicts, whereas previously we just assumed the root level
page tree node contained all of the page children directly.
This commit is contained in:
Matthew Olsson 2021-05-02 18:53:07 -07:00 committed by Andreas Kling
parent 8c745ad0d9
commit 3aeaceb727
4 changed files with 77 additions and 5 deletions

View file

@ -66,7 +66,14 @@ public:
UnwrappedValueType<T> resolve_to(const Value& value);
private:
// FIXME: Currently, to improve performance, we don't load any pages at Document
// construction, rather we just load the page structure and populate
// m_page_object_indices. However, we can be even lazier and defer page tree node
// parsing, as good PDF writers will layout the page tree in a balanced tree to
// improve lookup time. This would reduce the initial overhead by not loading
// every page tree node of, say, a 1000+ page PDF file.
void build_page_tree();
void add_page_tree_node_to_page_tree(NonnullRefPtr<DictObject> page_tree);
Parser m_parser;
XRefTable m_xref_table;