summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-op-run.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2018-01-22 18:43:01 +0000
committerTor Andersson <tor.andersson@artifex.com>2018-02-13 14:45:02 +0100
commit60aa2d2f7109bc8e975f949d88729f1f3e4e7ac3 (patch)
tree67ab8847fcf4d2a7ba8928227b3a561c46a5a7d8 /source/pdf/pdf-op-run.c
parent4e928c68b1852b860122bac28cc0f3af96c3156e (diff)
downloadmupdf-60aa2d2f7109bc8e975f949d88729f1f3e4e7ac3.tar.xz
Add fz_begin_layer/fz_end_layer.
Call these from the PDF interpreter. Make the DisplayList and Trace devices cope. Use these in the SVG output device.
Diffstat (limited to 'source/pdf/pdf-op-run.c')
-rw-r--r--source/pdf/pdf-op-run.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/pdf/pdf-op-run.c b/source/pdf/pdf-op-run.c
index c51bb535..355e94d2 100644
--- a/source/pdf/pdf-op-run.c
+++ b/source/pdf/pdf-op-run.c
@@ -1987,14 +1987,34 @@ static void pdf_run_DP(fz_context *ctx, pdf_processor *proc, const char *tag, pd
static void pdf_run_BMC(fz_context *ctx, pdf_processor *proc, const char *tag)
{
+ pdf_run_processor *pr = (pdf_run_processor *)proc;
+
+ if (!tag)
+ tag = "UnnamedLayer";
+
+ fz_begin_layer(ctx, pr->dev, tag);
}
static void pdf_run_BDC(fz_context *ctx, pdf_processor *proc, const char *tag, pdf_obj *raw, pdf_obj *cooked)
{
+ pdf_run_processor *pr = (pdf_run_processor *)proc;
+ const char *str;
+
+ if (!tag || strcmp(tag, "OC"))
+ return;
+
+ str = pdf_to_str_buf(ctx, pdf_dict_get(ctx, cooked, PDF_NAME_Name));
+ if (str == NULL)
+ str = "UnnamedLayer";
+
+ fz_begin_layer(ctx, pr->dev, str);
}
static void pdf_run_EMC(fz_context *ctx, pdf_processor *proc)
{
+ pdf_run_processor *pr = (pdf_run_processor *)proc;
+
+ fz_end_layer(ctx, pr->dev);
}
/* compatibility */