I need to use Mupdf insert some chinese text annotation. so I tested like this:
pdf_document *idoc;
struct fz_point_s sp = {200.0,200.0};
idoc = pdf_specifics(ctx, doc);
if (!idoc)
return;
fz_try(ctx)
{
float color[] = {0,0,0};
pdf_annot *annot = pdf_create_annot(ctx, idoc, (pdf_page *)page, FZ_ANNOT_TEXT);
pdf_set_free_text_details(ctx, idoc, annot, &sp,
"ABCDEF 中文注解" ,
"Helvetica",
24.0,
color);
/*pdf_set_annot_contents(ctx, idoc, annot, c);*/
pdf_update_annot(ctx, idoc, annot);
pdf_update_text_annot_appearance(ctx, idoc, annot);
pdf_update_free_text_annot_appearance(ctx, idoc, annot);
}
After running the result is not correct: image here
here is the annotation function:
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]);
so someone can help me with this?