summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-11-08 13:00:50 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-11-08 13:14:36 +0100
commitb58b05fe601458de72b35c336590c9def6602081 (patch)
treeaf2d692365b1a02710facb003d7e533fa649d349 /source/pdf
parent8ecdb40888d79fd0c92a4ac32490ba1140a330cf (diff)
downloadmupdf-b58b05fe601458de72b35c336590c9def6602081.tar.xz
Fix 699352: Call begin_layer for all marked content in PDF.
Since we call end_layer without distinction, we should also call begin_layer the same way. Also change the XML to emit separate tags for beginning and ending a layer, since there is no guarantee the layer calls will be neatly nested with clipping pushes and pops; nor is there a guarantee that the PDF will even balance the BMC/BDC and EMC operators.
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/pdf-op-run.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/pdf/pdf-op-run.c b/source/pdf/pdf-op-run.c
index f0ce5e9d..7d676214 100644
--- a/source/pdf/pdf-op-run.c
+++ b/source/pdf/pdf-op-run.c
@@ -2155,7 +2155,7 @@ 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";
+ tag = "Untitled";
fz_begin_layer(ctx, pr->dev, tag);
}
@@ -2165,12 +2165,12 @@ static void pdf_run_BDC(fz_context *ctx, pdf_processor *proc, const char *tag, p
pdf_run_processor *pr = (pdf_run_processor *)proc;
const char *str;
- if (!tag || strcmp(tag, "OC"))
- return;
+ if (!tag)
+ tag = "Untitled";
- str = pdf_dict_get_string(ctx, cooked, PDF_NAME(Name), NULL);
+ str = pdf_dict_get_text_string(ctx, cooked, PDF_NAME(Name));
if (strlen(str) == 0)
- str = "UnnamedLayer";
+ str = tag;
fz_begin_layer(ctx, pr->dev, str);
}