summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-xref.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-12-13 16:54:29 +0000
committerRobin Watts <robin.watts@artifex.com>2014-01-02 20:04:44 +0000
commitfc5bcdc79a12fb01b6cd07aa142c01ef11430b34 (patch)
tree547ed060a16453df001ffcb34657de46418872ff /source/pdf/pdf-xref.c
parent651f13408c67a8392ad93adda079c096d8a6118c (diff)
downloadmupdf-fc5bcdc79a12fb01b6cd07aa142c01ef11430b34.tar.xz
Add rebinding for fz_devices and fz_documents
The SVG device needs rebinding as it holds a file. The PDF device needs to rebind the underlying pdf document. All documents need to rebind their underlying streams.
Diffstat (limited to 'source/pdf/pdf-xref.c')
-rw-r--r--source/pdf/pdf-xref.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c
index a71dc1cf..523dd1f3 100644
--- a/source/pdf/pdf-xref.c
+++ b/source/pdf/pdf-xref.c
@@ -1941,6 +1941,13 @@ pdf_page_presentation(pdf_document *doc, pdf_page *page, float *duration)
return &page->transition;
}
+static void
+pdf_rebind(pdf_document *doc, fz_context *ctx)
+{
+ doc->ctx = ctx;
+ fz_rebind_stream(doc->file, ctx);
+}
+
/*
Initializers for the fz_document interface.
@@ -1973,6 +1980,7 @@ pdf_new_document(fz_context *ctx, fz_stream *file)
doc->super.meta = (void*)pdf_meta;
doc->super.page_presentation = (void*)pdf_page_presentation;
doc->super.write = (void*)pdf_write_document;
+ doc->super.rebind = (void*)pdf_rebind;
pdf_lexbuf_init(ctx, &doc->lexbuf.base, PDF_LEXBUF_LARGE);
doc->file = fz_keep_stream(file);