summaryrefslogtreecommitdiff
path: root/include/mupdf/pdf/xref.h
diff options
context:
space:
mode:
authorPaul Gardiner <paul.gardiner@artifex.com>2015-08-27 16:55:45 +0100
committerPaul Gardiner <paul.gardiner@artifex.com>2015-08-27 16:55:45 +0100
commit0d74c055c16c391a76c79cec4eb7636e72a407f9 (patch)
tree2529bcb973074e9d49fa32f712564c5fb802b86c /include/mupdf/pdf/xref.h
parent71459622bc78f03c379c59f1e60a9008147b32fc (diff)
downloadmupdf-0d74c055c16c391a76c79cec4eb7636e72a407f9.tar.xz
Support several levels of incremental xref
This fixes bug #696123 by allowing multiple signatures each to be written to the document in a separate incemental update. Add count num_incremental_sections to keep track of the number of incremental sections. Add xref_base, which can be set between 0 and num_incremental_sections inclusive to access different versions of the document. Add disallow_new_increments flag that stops new incremental sections being provoked by the creation of an xref stream. Move the unsaved_sigs list from the document structure to the xref structure. With this commit in place, the lists will never grow beyond length one, but we've maintained the list structure in case other cases need supporting in the future. Add an end offset field to the xref structure, so that during completion of signatures the document length of the various incremental versions of the document are available. Factor out functions for storing unsaved signatures and for checking if an object is an unsaved signature. Do deep copy of objects that require the holding of several versions.
Diffstat (limited to 'include/mupdf/pdf/xref.h')
-rw-r--r--include/mupdf/pdf/xref.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/mupdf/pdf/xref.h b/include/mupdf/pdf/xref.h
index 845c936e..30b59222 100644
--- a/include/mupdf/pdf/xref.h
+++ b/include/mupdf/pdf/xref.h
@@ -63,6 +63,9 @@ struct pdf_xref_s
pdf_xref_subsec *subsec;
pdf_obj *trailer;
pdf_obj *pre_repair_trailer;
+ pdf_unsaved_sig *unsaved_sigs;
+ pdf_unsaved_sig **unsaved_sigs_end;
+ fz_off_t end_ofs; /* file offset to end of xref */
};
pdf_xref_entry *pdf_cache_object(fz_context *ctx, pdf_document *doc, int num, int gen);
@@ -94,6 +97,8 @@ pdf_xref_entry *pdf_get_xref_entry(fz_context *ctx, pdf_document *doc, int i);
void pdf_replace_xref(fz_context *ctx, pdf_document *doc, pdf_xref_entry *entries, int n);
void pdf_xref_ensure_incremental_object(fz_context *ctx, pdf_document *doc, int num);
int pdf_xref_is_incremental(fz_context *ctx, pdf_document *doc, int num);
+void pdf_xref_store_unsaved_signature(fz_context *ctx, pdf_document *doc, pdf_obj *field, pdf_signer *signer);
+int pdf_xref_obj_is_unsaved_signature(pdf_document *doc, pdf_obj *obj);
void pdf_repair_xref(fz_context *ctx, pdf_document *doc);
void pdf_repair_obj_stms(fz_context *ctx, pdf_document *doc);