| <<<Back 1 day (to 2020/12/08) | Fwd 1 day (to 2020/12/10)>>> | 20201209 |
SanDita | How to create a new Page, write the Bitmap data into it and save it into the document? | 06:37.44 |
| pdf_add_page how is it add bitmap data? | 08:29.51 |
sebras | SanDita: pdf_add_page() adds a page and its contents, but you also need to add the image itself. | 08:42.18 |
| SanDita: if you want to do everything manually I suggest looking at source/tools/mucreate.c::create_page() since it shows how it calls add_image_res() (which calls other API functions), and then pdf_add_page(). | 08:43.26 |
| SanDita: if you don't need to do this in C, maybe mutool create is suitable. an alternative is to write a javascript and supply it to mutoolrun | 08:44.22 |
SanDita | this dir not this file | 08:59.49 |
| sebras | 09:00.14 |
| this dir no this file | 09:00.25 |
| pdf_document *document = pdf_open_document(ctx, fileName_); | 09:04.06 |
| document, 2, pdfObj); | 09:04.07 |
| The page I added with the above code is blank. I am sure that Pixmap is a piece of image data | 09:04.08 |
sebras | SanDita: http://git.ghostscript.com/?p=mupdf.git;a=blob;f=source/tools/pdfcreate.c;h=e98a8a3c5d1cdd68c306216f837d52d22d0a1ff1;hb=HEAD#l139 | 09:05.58 |
| this is create_page() from mutool create. | 09:06.18 |
| as you can see it calls add_image_res() to add the image, and then pdf_add_page() to add the page. | 09:07.19 |
| this just adds the image so it can be displayed on the page. | 09:08.16 |
| to make it appear you also need to provide a suitable Contents string. | 09:08.30 |
| you can see an example here: https://mupdf.com/docs/manual-mutool-create.html | 09:08.35 |
| to know what operators to use you'll need to read the PDF Reference | 09:09.04 |
| SanDita: if you want to script it, maybe this works for you? mutool convert -F pdf -o out.pdf pic.jpg | 09:13.46 |
SanDita | I am running MUPDF on android | 09:14.48 |
| I want to transfer the JAVA Bitmap data to JNI and then create a new page of PDF and insert the PDF file and save | 09:15.39 |
| Or is there an easier way to replace the data of a certain page | 09:31.19 |
| sebras | 09:31.27 |
| <<<Back 1 day (to 2020/12/08) | Forward 1 day (to 2020/12/10)>>> | |