Win version mutool.exe from mupdf-1.3-windows.zip. I tried to extract raw stream data from PDF file with cmd: 'mutool show -b -e src.pdf 7 > 7obj' but data in 7obj file was corrupted. All LF symbols were replaced by a pair of CR,LF symbols. So I decided it was because of the wrong mode of 'stdout'. By default, 'stdout' mode is _O_TEXT, but for correct output it must be a _O_BINARY. I downloaded the mupdf-1.3-source.tar.gz source archive and corrected the following in it: [\mupdf-1.3-source\source\tools\pdfshow.c, line 100]: In func showstream(int num, int gen), add these lines: if (showbinary) if (-1 == _setmode(_fileno(stdout), _O_BINARY)) perror("ERROR: Cannot set 'stdout' mode to binary.\n"); As you see, only "-b -e" combination affected. The output for "-b" or "-e" alone wasn't changed. This code for Win version only! mutool now works properly. Sorry for my English... CY, Suntor, Russia
Use the mutool show -o option (new in version 1.4) to specify an output file instead of using file redirection on windows.