c - How to set an image as background of an annotation in MuPDF? -
i want set image background of annotation in mupdf using following code:
fz_context *ctx = doc->ctx; const fz_matrix *page_ctm = &annot->page->ctm; image_document *image_doc = (image_document *)fz_open_document(ctx, "/users/zidane/downloads/a.jpg"); fz_image *image = image_doc->image; fz_matrix local_ctm = *page_ctm; float w = image->w * dpi / image->xres; float h = image->h * dpi / image->yres; fz_pre_scale(&local_ctm, w, h); fz_pre_translate(&local_ctm, 0, -1); fz_fill_image(dev, image, &local_ctm, 1);
can tell me why not work?
Comments
Post a Comment