pub fn flatten_cached(document: &PdfDocument) -> Result<Arc<Vec<u8>>, XfaError>Expand description
flatten through the process-wide content-addressed cache (#468).
Returns the same bytes as flatten for the same document; only the cost
differs. The cache key is a hash of the document bytes, so a document that
was mutated (any changed byte) is flattened again and an unchanged one is
not. This is what rendering uses: before it, every render_page call on an
XFA form paid the full flatten (117 to 729 ms on the corpus forms).