summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-11-09 15:13:51 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-11-09 15:13:51 +0100
commit177b010e665cccf299a328b082855890dc5190b5 (patch)
tree8643476e071a33eb4ee1bac9cfd35098aa8ab6bf /platform
parentb52c5fd8b395403cab65abc9a44b15d710725757 (diff)
downloadmupdf-177b010e665cccf299a328b082855890dc5190b5.tar.xz
Fix 695893: Match page rotation when creating FreeText annotations.
This uses an undocumented Rotate property of annotations, which is also used by Adobe.
Diffstat (limited to 'platform')
-rw-r--r--platform/gl/gl-annotate.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/gl/gl-annotate.c b/platform/gl/gl-annotate.c
index 155cac24..89ce0271 100644
--- a/platform/gl/gl-annotate.c
+++ b/platform/gl/gl-annotate.c
@@ -126,6 +126,11 @@ static void new_annot(int type)
case PDF_ANNOT_FREE_TEXT:
{
fz_rect text_rect = { 12, 12, 12+200, 12+100 };
+
+ /* Use undocumented Adobe property to match page rotation. */
+ int rot = pdf_to_int(ctx, pdf_dict_get_inheritable(ctx, page->obj, PDF_NAME(Rotate)));
+ pdf_dict_put_int(ctx, selected_annot->obj, PDF_NAME(Rotate), rot);
+
pdf_set_annot_rect(ctx, selected_annot, text_rect);
pdf_set_annot_border(ctx, selected_annot, 0);
pdf_set_annot_default_appearance(ctx, selected_annot, "Helv", 12, black);