summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-appearance.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2017-07-18 23:20:33 +0800
committerSebastian Rasmussen <sebras@gmail.com>2017-07-20 01:22:43 +0800
commitc56b659155991d0c8839ca38244056d9c5abf0f2 (patch)
tree4b065526c79ef407f7dd82c3cd36226cc2fce9db /source/pdf/pdf-appearance.c
parent2a7161bb864a16449c0648333a2d031aae41db7c (diff)
downloadmupdf-c56b659155991d0c8839ca38244056d9c5abf0f2.tar.xz
Use annotation color when synthesizing text annotations.
Diffstat (limited to 'source/pdf/pdf-appearance.c')
-rw-r--r--source/pdf/pdf-appearance.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/pdf/pdf-appearance.c b/source/pdf/pdf-appearance.c
index 600cfcb4..f6414e15 100644
--- a/source/pdf/pdf-appearance.c
+++ b/source/pdf/pdf-appearance.c
@@ -1535,6 +1535,7 @@ void pdf_update_text_markup_appearance(fz_context *ctx, pdf_document *doc, pdf_a
float alpha;
float line_height;
float line_thickness;
+ pdf_obj *annotcolor;
switch (type)
{
@@ -1566,6 +1567,15 @@ void pdf_update_text_markup_appearance(fz_context *ctx, pdf_document *doc, pdf_a
return;
}
+ annotcolor = pdf_dict_get(ctx, annot->obj, PDF_NAME_C);
+
+ if (pdf_is_array(ctx, annotcolor))
+ {
+ color[0] = pdf_to_int(ctx, pdf_array_get(ctx, annotcolor, 0));
+ color[1] = pdf_to_int(ctx, pdf_array_get(ctx, annotcolor, 1));
+ color[2] = pdf_to_int(ctx, pdf_array_get(ctx, annotcolor, 2));
+ }
+
pdf_set_markup_appearance(ctx, doc, annot, color, alpha, line_thickness, line_height);
}