diff options
author | Robin Watts <robin.watts@artifex.com> | 2013-12-13 16:54:29 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2014-01-02 20:04:44 +0000 |
commit | fc5bcdc79a12fb01b6cd07aa142c01ef11430b34 (patch) | |
tree | 547ed060a16453df001ffcb34657de46418872ff /source/pdf/pdf-device.c | |
parent | 651f13408c67a8392ad93adda079c096d8a6118c (diff) | |
download | mupdf-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-device.c')
-rw-r--r-- | source/pdf/pdf-device.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/pdf/pdf-device.c b/source/pdf/pdf-device.c index 39c19627..633d9975 100644 --- a/source/pdf/pdf-device.c +++ b/source/pdf/pdf-device.c @@ -1277,6 +1277,14 @@ pdf_dev_free_user(fz_device *dev) fz_free(ctx, pdev); } +static void +pdf_dev_rebind(fz_device *dev) +{ + pdf_device *pdev = dev->user; + + fz_rebind_document((fz_document *)pdev->doc, dev->ctx); +} + fz_device *pdf_new_pdf_device(pdf_document *doc, pdf_obj *contents, pdf_obj *resources, const fz_matrix *ctm) { fz_context *ctx = doc->ctx; @@ -1313,6 +1321,7 @@ fz_device *pdf_new_pdf_device(pdf_document *doc, pdf_obj *contents, pdf_obj *res fz_rethrow(ctx); } + dev->rebind = pdf_dev_rebind; dev->free_user = pdf_dev_free_user; dev->fill_path = pdf_dev_fill_path; |