| <<<Back 1 day (to 2018/04/09) | 20180410 |
BlackWirex | Question: Is there a way to use mutool to extract just all images from one page? I only have one image per page and am looking simply to extract that image for stdout purposes. | 01:59.22 |
sebras | BlackWirex: if you run mutool info -I document.pdf it will list all image objects on all pages | 04:33.29 |
| BlackWirex: the number to the left is the page number, the number furthes to the right is the object number in the pdf, e.g. 42 0 R | 04:33.56 |
| in brackets you will see what type of image it is, e.g. DCT, implying JPEG. | 04:34.53 |
| BlackWirex: next you can run mutool show -be document.pdf 42 > 42.jpeg | 04:35.09 |
| and you'll have the JPEG image in a separate file. | 04:35.25 |
| if the image is encoded using JBIG2 it will be a JBIG2 bit stream instead. | 04:35.47 |
| this is extracting the encoded image data. | 04:36.58 |
| if you want the _decoded_ image data, perhaps tor8 knows of a different method. I rarely need that kind if data so I haven't figured out a way to do that yet. | 04:37.44 |
tor8 | BlackWirex: sebras: if you know the object numbers (that you can get from sebras' "mutool info" example above) you can extract the image using mutool extract by specifying that number | 09:25.13 |
| there is not currently a convenient way to extract the images on a specific page | 09:25.34 |
| though it would be trivial to cook up either a shell script or "mutool run" script to do it | 09:26.06 |
sebras | tor8: mutool has too many functions. :) | 10:24.16 |
Robin_Watts | kens: FWIW, that mail to support doesn't sound like a bug to me. | 13:18.59 |
kens | Robin_Watts : I couldn't really make much of it | 13:19.16 |
| Not clear to me why he couldn't see the file | 13:19.33 |
| My main point to him was that the support email address was the wrong place | 13:19.48 |
Robin_Watts | He can see it in MuPDF. | 13:19.49 |
| He can't see it in the file explorer (which suggests to me that it's a synthesised directory, made by merging several real dirs) | 13:20.29 |
| So it's not a bug in MuPDF. | 13:20.38 |
| Yes, your main point was valid. | 13:20.48 |
| But if he opens it as a bug in bugzilla, I'll close it. | 13:21.00 |
kens | That's fair enough, provided you give him that explanation of course. | 13:21.20 |
| There you go Robin_Watts | 13:38.12 |
| https://bugs.ghostscript.com/show_bug.cgi?id=699205 | 13:39.40 |
Robin_Watts | Sorted. Ta. | 13:43.41 |
kens | NP thanks for replying to it | 13:43.54 |
sebras | tor8 (for the logs): silly patch on sebras/master because I happend to run into it... | 18:24.15 |
| Forward 1 day (to 2018/04/11)>>> | |