mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:17:35 +00:00
LibPDF: Allow reading documents with incremental updates
The PDF spec allows incremental changes of a document by appending a new XRef table and file trailer to it. These will only contain the changed objects and will point back to the previous change, forming an arbitrarily long chain of XRef sections and file trailers. Every one of those XRef sections may be encoded as an XRef stream as well, in which case the trailer is part of the stream dictionary as usual. To make this easier, I made it so every XRef table may "own" a trailer. This means that the main file trailer is now part of the main XRef table.
This commit is contained in:
parent
0c230f5ff0
commit
34350ee9e7
3 changed files with 41 additions and 25 deletions
|
@ -20,7 +20,7 @@ public:
|
|||
Linearized,
|
||||
};
|
||||
|
||||
[[nodiscard]] ALWAYS_INLINE RefPtr<DictObject> const& trailer() const { return m_trailer; }
|
||||
[[nodiscard]] ALWAYS_INLINE RefPtr<DictObject> const& trailer() const { return m_xref_table->trailer(); }
|
||||
|
||||
// Parses the header and initializes the xref table and trailer
|
||||
PDFErrorOr<void> initialize();
|
||||
|
@ -94,7 +94,6 @@ private:
|
|||
bool navigate_to_after_startxref();
|
||||
|
||||
RefPtr<XRefTable> m_xref_table;
|
||||
RefPtr<DictObject> m_trailer;
|
||||
Optional<LinearizationDictionary> m_linearization_dictionary;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue