summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-annot.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-07-17 18:42:33 +0100
committerRobin Watts <robin.watts@artifex.com>2013-07-19 19:54:27 +0100
commitf5f7c0e4dd83257f526b158e3998970717852a0e (patch)
treec34ee93ab7773e4fbe48506c97fb515c03707e57 /source/pdf/pdf-annot.c
parent3c559928d88fccfe17da4953ea1c93ceb42a90cb (diff)
downloadmupdf-f5f7c0e4dd83257f526b158e3998970717852a0e.tar.xz
Initial work on progressive loading
We are testing this using a new -p flag to mupdf that sets a bitrate at which data will appear to arrive progressively as time goes on. For example: mupdf -p 102400 pdf_reference17.pdf Details of the scheme used here are presented in docs/progressive.txt
Diffstat (limited to 'source/pdf/pdf-annot.c')
-rw-r--r--source/pdf/pdf-annot.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/pdf/pdf-annot.c b/source/pdf/pdf-annot.c
index c571a0a1..4c76fce9 100644
--- a/source/pdf/pdf-annot.c
+++ b/source/pdf/pdf-annot.c
@@ -331,6 +331,7 @@ pdf_load_link_annots(pdf_document *doc, pdf_obj *annots, const fz_matrix *page_c
n = pdf_array_len(annots);
for (i = 0; i < n; i++)
{
+ /* FIXME: Move the try/catch out of the loop for performance? */
fz_try(doc->ctx)
{
obj = pdf_array_get(annots, i);
@@ -338,7 +339,7 @@ pdf_load_link_annots(pdf_document *doc, pdf_obj *annots, const fz_matrix *page_c
}
fz_catch(doc->ctx)
{
- /* FIXME: TryLater */
+ fz_rethrow_if(doc->ctx, FZ_ERROR_TRYLATER);
link = NULL;
}
@@ -594,9 +595,13 @@ pdf_load_annots(pdf_document *doc, pdf_obj *annots, pdf_page *page)
}
fz_catch(ctx)
{
+ if (fz_caught(ctx) == FZ_ERROR_TRYLATER)
+ {
+ pdf_free_annot(ctx, head);
+ fz_rethrow(ctx);
+ }
keep_annot = 0;
fz_warn(ctx, "ignoring broken annotation");
- /* FIXME: TryLater */
}
if (!keep_annot)
{
@@ -657,8 +662,8 @@ pdf_update_annot(pdf_document *doc, pdf_annot *annot)
}
fz_catch(ctx)
{
+ fz_rethrow_if(ctx, FZ_ERROR_TRYLATER);
fz_warn(ctx, "ignoring broken annotation");
- /* FIXME: TryLater */
}
}
}