diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-05-24 12:14:04 +0200 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2018-06-22 16:48:45 +0100 |
commit | 2e4cabe774d46dda735164e137f0ed11885bbec5 (patch) | |
tree | 0b7a29081c51d17c5b2a95814c3398c91d2004df /source/pdf | |
parent | 0bf88278d160b93a6103c36e885a5db4980e92d6 (diff) | |
download | mupdf-2e4cabe774d46dda735164e137f0ed11885bbec5.tar.xz |
Remove rich text properties when editing annotation contents or styles.
We do not support rich text content; remove the properties rather than
leave them untouched and out of sync with the simple contents and styles.
Diffstat (limited to 'source/pdf')
-rw-r--r-- | source/pdf/pdf-annot-edit.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/pdf/pdf-annot-edit.c b/source/pdf/pdf-annot-edit.c index 55821e4f..decf5027 100644 --- a/source/pdf/pdf-annot-edit.c +++ b/source/pdf/pdf-annot-edit.c @@ -270,6 +270,7 @@ void pdf_set_annot_contents(fz_context *ctx, pdf_annot *annot, const char *text) { pdf_dict_put_text_string(ctx, annot->obj, PDF_NAME(Contents), text); + pdf_dict_del(ctx, annot->obj, PDF_NAME(RC)); /* not supported */ pdf_dirty_annot(ctx, annot); } @@ -496,6 +497,10 @@ pdf_set_annot_border(fz_context *ctx, pdf_annot *annot, float w) if (!pdf_is_dict(ctx, bs)) bs = pdf_dict_put_dict(ctx, annot->obj, PDF_NAME(BS), 1); pdf_dict_put_real(ctx, bs, PDF_NAME(W), w); + + pdf_dict_del(ctx, annot->obj, PDF_NAME(Border)); /* deprecated */ + pdf_dict_del(ctx, annot->obj, PDF_NAME(BE)); /* not supported */ + pdf_dirty_annot(ctx, annot); } @@ -1352,5 +1357,9 @@ pdf_set_annot_default_appearance(fz_context *ctx, pdf_annot *annot, const char * pdf_print_default_appearance(ctx, buf, sizeof buf, font, size, color); pdf_dict_put_string(ctx, annot->obj, PDF_NAME(DA), buf, strlen(buf)); + + pdf_dict_del(ctx, annot->obj, PDF_NAME(DS)); /* not supported */ + pdf_dict_del(ctx, annot->obj, PDF_NAME(RC)); /* not supported */ + pdf_dirty_annot(ctx, annot); } |