summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-03-20 16:10:11 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-03-22 14:58:18 +0100
commite0c0500042bf90193c5deb196dafa5cdb64ec0dc (patch)
tree1d579e5ec2fcea11c1a293fdd5e348e3e8f999da /source/pdf
parent6d433a5702bda01f17407be6c272eae8653d1800 (diff)
downloadmupdf-e0c0500042bf90193c5deb196dafa5cdb64ec0dc.tar.xz
Add pdf_add_new_dict family of functions.
Create a new empty dictionary, add it to the xref and return a new indirect reference object that points to it. This indirect reference needs to be dropped, since it was created with a function using the 'new' keyword.
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/pdf-xref.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
index 133ac570..2f3741d0 100644
--- a/source/pdf/pdf-xref.c
+++ b/source/pdf/pdf-xref.c
@@ -2678,6 +2678,18 @@ pdf_add_object_drop(fz_context *ctx, pdf_document *doc, pdf_obj *obj)
}
pdf_obj *
+pdf_add_new_dict(fz_context *ctx, pdf_document *doc, int initial)
+{
+ return pdf_add_object_drop(ctx, doc, pdf_new_dict(ctx, doc, initial));
+}
+
+pdf_obj *
+pdf_add_new_array(fz_context *ctx, pdf_document *doc, int initial)
+{
+ return pdf_add_object_drop(ctx, doc, pdf_new_array(ctx, doc, initial));
+}
+
+pdf_obj *
pdf_add_stream(fz_context *ctx, pdf_document *doc, fz_buffer *buf, pdf_obj *obj, int compressed)
{
pdf_obj *ind;