The xref table: adding, removing and replacing indirect objects.

The following functions create a new slot in the xref table and populate it with the object obj. They return a indirect object, which represents the new xref entry. The latter function does not increase the refcount of obj.

 pdf_obj *pdf_add_object(fz_context *ctx, pdf_document *doc, pdf_obj *obj);
 pdf_obj *pdf_add_object_drop(fz_context *ctx, pdf_document *doc, pdf_obj *obj);