Search code examples
androidiospdfmupdf

Is it possible to add a page or replace a page in mupdf library?


I'm using mupdf in one of my project. It nearly meets almost my requirement except that I don't know if it supports to add new page or replace a new page?

The demo of mupdf shows how to add a layer to the current page (draw on the page) and save it. But I can't find the function to add new page and delete page. Can anybody advise? Thanks


Solution

  • Just some hints/ideas.

    I'm not so sure that is available such method with the java jni wrapper.

    But MuPDF allow you to add/delete a page. If you look at the source code include/mupdf/pdf/document.h:

    pdf_page *pdf_create_page(pdf_document *doc, fz_rect rect, int res, int rotate);
    void pdf_delete_page(pdf_document *doc, int number);
    void pdf_delete_page_range(pdf_document *doc, int start, int end);
    

    If you know C, you could try to add your jni wrapper functions to platform / android / jni / mupdf.c