From fc5bcdc79a12fb01b6cd07aa142c01ef11430b34 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Fri, 13 Dec 2013 16:54:29 +0000 Subject: 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. --- source/pdf/pdf-xref.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/pdf/pdf-xref.c') 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); -- cgit v1.2.3