From c92707fece670689c9dd7470e35bdc802946dc45 Mon Sep 17 00:00:00 2001 From: Michael Vrhel Date: Wed, 22 Jun 2016 13:20:45 -0700 Subject: Add support for getting additional annotation information GSView will make use of the details about the annotations including the author, the date and which annotation the annotation is in reply to. This commit provides the interface to do this easily. --- source/pdf/pdf-annot-edit.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'source/pdf') diff --git a/source/pdf/pdf-annot-edit.c b/source/pdf/pdf-annot-edit.c index 4d5d924c..d073a699 100644 --- a/source/pdf/pdf-annot-edit.c +++ b/source/pdf/pdf-annot-edit.c @@ -373,11 +373,26 @@ void pdf_set_annot_contents(fz_context *ctx, pdf_document *doc, pdf_annot *annot pdf_dict_put_drop(ctx, annot->obj, PDF_NAME_Contents, pdf_new_string(ctx, doc, text, strlen(text))); } -char *pdf_annot_contents(fz_context *ctx, pdf_document *doc, pdf_annot *annot) +char *pdf_annot_contents(fz_context *ctx, pdf_annot *annot) { return pdf_to_str_buf(ctx, pdf_dict_get(ctx, annot->obj, PDF_NAME_Contents)); } +char *pdf_annot_author(fz_context *ctx, pdf_annot *annot) +{ + return pdf_to_str_buf(ctx, pdf_dict_get(ctx, annot->obj, PDF_NAME_T)); +} + +char *pdf_annot_date(fz_context *ctx, pdf_annot *annot) +{ + return pdf_to_str_buf(ctx, pdf_dict_get(ctx, annot->obj, PDF_NAME_CreationDate)); +} + +pdf_obj *pdf_annot_irt(fz_context *ctx, pdf_annot *annot) +{ + return pdf_dict_get(ctx, annot->obj, PDF_NAME_IRT); +} + void pdf_set_free_text_details(fz_context *ctx, pdf_document *doc, pdf_annot *annot, fz_point *pos, char *text, char *font_name, float font_size, float color[3]) { char nbuf[32]; -- cgit v1.2.3