diff options
-rw-r--r-- | include/mupdf/pdf/annot.h | 7 | ||||
-rw-r--r-- | source/pdf/pdf-annot-edit.c | 28 |
2 files changed, 34 insertions, 1 deletions
diff --git a/include/mupdf/pdf/annot.h b/include/mupdf/pdf/annot.h index 11ce0fba..58c11a33 100644 --- a/include/mupdf/pdf/annot.h +++ b/include/mupdf/pdf/annot.h @@ -190,11 +190,16 @@ void pdf_set_annot_ink_list(fz_context *ctx, pdf_annot *annot, int n, const int void pdf_clear_annot_ink_list(fz_context *ctx, pdf_annot *annot); void pdf_add_annot_ink_list(fz_context *ctx, pdf_annot *annot, int n, fz_point stroke[]); -void pdf_set_annot_line_ending_styles(fz_context *ctx, pdf_annot *annot, enum pdf_line_ending start_style, enum pdf_line_ending end_style); void pdf_set_annot_icon_name(fz_context *ctx, pdf_annot *annot, const char *name); void pdf_set_annot_is_open(fz_context *ctx, pdf_annot *annot, int is_open); +enum pdf_line_ending pdf_annot_line_start_style(fz_context *ctx, pdf_annot *annot); +enum pdf_line_ending pdf_annot_line_end_style(fz_context *ctx, pdf_annot *annot); void pdf_annot_line_ending_styles(fz_context *ctx, pdf_annot *annot, enum pdf_line_ending *start_style, enum pdf_line_ending *end_style); +void pdf_set_annot_line_start_style(fz_context *ctx, pdf_annot *annot, enum pdf_line_ending s); +void pdf_set_annot_line_end_style(fz_context *ctx, pdf_annot *annot, enum pdf_line_ending e); +void pdf_set_annot_line_ending_styles(fz_context *ctx, pdf_annot *annot, enum pdf_line_ending start_style, enum pdf_line_ending end_style); + const char *pdf_annot_icon_name(fz_context *ctx, pdf_annot *annot); int pdf_annot_is_open(fz_context *ctx, pdf_annot *annot); diff --git a/source/pdf/pdf-annot-edit.c b/source/pdf/pdf-annot-edit.c index b6cda909..d9a3ec2d 100644 --- a/source/pdf/pdf-annot-edit.c +++ b/source/pdf/pdf-annot-edit.c @@ -442,6 +442,20 @@ pdf_annot_line_ending_styles(fz_context *ctx, pdf_annot *annot, *end_style = pdf_line_ending_from_name(ctx, pdf_array_get(ctx, style, 1)); } +enum pdf_line_ending +pdf_annot_line_start_style(fz_context *ctx, pdf_annot *annot) +{ + pdf_obj *le = pdf_dict_get(ctx, annot->obj, PDF_NAME_LE); + return pdf_line_ending_from_name(ctx, pdf_array_get(ctx, le, 0)); +} + +enum pdf_line_ending +pdf_annot_line_end_style(fz_context *ctx, pdf_annot *annot) +{ + pdf_obj *le = pdf_dict_get(ctx, annot->obj, PDF_NAME_LE); + return pdf_line_ending_from_name(ctx, pdf_array_get(ctx, le, 1)); +} + void pdf_set_annot_line_ending_styles(fz_context *ctx, pdf_annot *annot, enum pdf_line_ending start_style, @@ -457,6 +471,20 @@ pdf_set_annot_line_ending_styles(fz_context *ctx, pdf_annot *annot, pdf_dirty_annot(ctx, annot); } +void +pdf_set_annot_line_start_style(fz_context *ctx, pdf_annot *annot, enum pdf_line_ending s) +{ + enum pdf_line_ending e = pdf_annot_line_end_style(ctx, annot); + pdf_set_annot_line_ending_styles(ctx, annot, s, e); +} + +void +pdf_set_annot_line_end_style(fz_context *ctx, pdf_annot *annot, enum pdf_line_ending e) +{ + enum pdf_line_ending s = pdf_annot_line_start_style(ctx, annot); + pdf_set_annot_line_ending_styles(ctx, annot, s, e); +} + float pdf_annot_border(fz_context *ctx, pdf_annot *annot) { |