From ed28a166dace50d1a555689b9d5353e62a1b1e69 Mon Sep 17 00:00:00 2001 From: Fred Ross-Perry Date: Mon, 13 Nov 2017 17:04:06 -0800 Subject: jni/js: Use correct text encoding in annotation author and contents. Also clarify that a copy of author/contents is returned, and that the caller must free them. --- include/mupdf/pdf/annot.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/mupdf/pdf/annot.h b/include/mupdf/pdf/annot.h index df068bc1..e03ded3f 100644 --- a/include/mupdf/pdf/annot.h +++ b/include/mupdf/pdf/annot.h @@ -144,6 +144,7 @@ int pdf_annot_has_interior_color(fz_context *ctx, pdf_annot *annot); int pdf_annot_has_line_ending_styles(fz_context *ctx, pdf_annot *annot); int pdf_annot_has_icon_name(fz_context *ctx, pdf_annot *annot); int pdf_annot_has_open(fz_context *ctx, pdf_annot *annot); +int pdf_annot_has_author(fz_context *ctx, pdf_annot *annot); int pdf_annot_flags(fz_context *ctx, pdf_annot *annot); void pdf_annot_rect(fz_context *ctx, pdf_annot *annot, fz_rect *rect); @@ -183,20 +184,25 @@ void pdf_annot_vertex(fz_context *ctx, pdf_annot *annot, int i, float v[2]); */ void pdf_set_text_annot_position(fz_context *ctx, pdf_annot *annot, fz_point pt); +/* + pdf_copy_annot_contents: return a copy of the contents of an annotation. +*/ +char *pdf_copy_annot_contents(fz_context *ctx, pdf_annot *annot); + /* pdf_set_annot_contents: set the contents of an annotation. */ void pdf_set_annot_contents(fz_context *ctx, pdf_annot *annot, const char *text); /* - pdf_annot_contents: return the contents of an annotation. + pdf_copy_annot_author: return a copy of the author of an annotation. */ -const char *pdf_annot_contents(fz_context *ctx, pdf_annot *annot); +char *pdf_copy_annot_author(fz_context *ctx, pdf_annot *annot); /* - pdf_annot_author: return the author of an annotation. + pdf_set_annot_author: set the author of an annotation. */ -const char *pdf_annot_author(fz_context *ctx, pdf_annot *annot); +void pdf_set_annot_author(fz_context *ctx, pdf_annot *annot, const char *author); /* pdf_annot_author: return the date of an annotation. -- cgit v1.2.3