| <<<Back 1 day (to 2017/09/28) | 20170929 |
Ionic | tor8: is it intentional that mutool draw does not output anything to stdout unless given -o - explicitly? reading the source code (both for my currently installed version 0.11 and current git HEAD), I see that it should indeed default to outputting to stdout - but it's not. instead, mutool draw foo.pdf is just a sophisticated way to burn CPU cycles. | 00:01.09 |
| that should have been 1.11 naturally | 00:03.11 |
DomiX | hi, I'm searching a tool to delete a page from a pdf but I do not find the command | 11:51.13 |
tor8 | DomiX: you can use mutool clean. if you want to delete page 5: "mutool clean input.pdf output.pdf 1-4,6-N" | 12:26.55 |
Robin_Watts | tor8: 'N' ? | 13:20.00 |
kens | Where N is the last required page I would guess | 13:20.18 |
Robin_Watts | just 6- will do, I think. | 13:20.25 |
kens | If you want all the remaining pages maybe, but not if you want to stop before the end I would imagine | 13:20.45 |
Robin_Watts | kens: yeah, but the original question was to just remove page 5. Not important really, just that he might come back in 5 mins and say "hey, it didn't work..." :) | 13:23.30 |
kens | Well, he might, but I doubt it. As I commented over in #artifex | 13:24.08 |
Robin_Watts | kens: mmm. | 13:24.41 |
tor8 | no, literal N to mean the last page in the document | 13:32.59 |
kens | Hmm, that's different to the GS implementation then, I coded it so - with no trailer means 'to the end' | 13:33.38 |
tor8 | not sure if the parser handles 6- but I know it does cope with 6-N | 13:33.42 |
kens | Fair enough, GS definitiely won't understand N | 13:34.03 |
tor8 | that way you can reverse pages with "N-1" for example | 13:34.13 |
kens | AH, I'm not sure I considered reversing pages | 13:34.38 |
| I did implement even and odd | 13:34.45 |
Ionic | tor8: did you see my message? | 13:40.51 |
tor8 | Ionic: questions about command line options to mudraw are better addressed to Robin_Watts | 13:53.27 |
Ionic | either one is fine :) | 13:53.42 |
| I just feel that this is more of a bug than an intended feature | 13:53.56 |
tor8 | the default for mudraw is indeed to burn cycles | 13:53.59 |
| we use it like that to burn cycles and then count them with the -s flag | 13:54.22 |
| or -s5 to do a bitmap checksum when doing regression testing, etc. | 13:54.49 |
| if you don't need the fine grained control over banded rendering that mutool draw gives you, mutool convert has an easier and more consistent command line | 13:55.40 |
| but I don't think mutool convert writes to stdout at all | 13:56.06 |
Ionic | that's weird, because from http://git.ghostscript.com/?p=mupdf.git;a=blob;f=source/tools/mudraw.c;h=2ec4eaa5ee06c584c55d8cd5b55f875fade4f0e1;hb=HEAD#l1732 I gathered that the default should be output to stdout | 13:56.57 |
| maybe I haven't analyzed it deeply enough though | 13:57.46 |
tor8 | the code is more convoluted than that... | 13:58.00 |
| if you use the pdfwrite device with mutool draw and don't give a file name it will write to "out.pdf" | 13:58.24 |
Ionic | I've seen that OUT_PDF is handled differently, yeah | 13:59.02 |
tor8 | and text output will print to stdout | 13:59.27 |
| but png output will not print to stdout | 13:59.33 |
Ionic | and some others | 13:59.44 |
tor8 | bitmap output will not print to stdout would be a more accurate statement | 14:00.00 |
Ionic | okay, so it sounds like that's really intentional, even if the main function is a bit misleading in that case | 14:01.00 |
tor8 | yes. it's a tool that has grown organically and sported a fair number of mutations and tumors along the way :) | 14:01.28 |
Ionic | ah yeah, bitmap functions check for if (output) and only write data out if that's actually non-NULL | 14:02.06 |
tor8 | I think it's so you don't accidentally destroy your terminal by dumping lots of binary data to it | 14:02.27 |
Ionic | via the bander | 14:02.30 |
| well, a lot of bitmap tools (for instance netpbm) write to stdout by default | 14:02.56 |
Robin_Watts | -o - *should* dump to the console, but that has problems on windows with binary stuff. | 14:02.57 |
Ionic | Robin_Watts: yeah, that's working correctly - I was just thrown off that not providing -o at all doesn't write out any data with bitmap output | 14:04.41 |
| even though the mudraw main function initializes the internal out variable to stdout in such a case - but bitmap output actually only outputs data if -o was explicitly provided | 14:05.42 |
| Forward 1 day (to 2017/09/30)>>> | |