Как конвертировать pdf в оттенки серого через mutool (mupdf-tools)

1172
Salal Aslam

Я хочу конвертировать PDF в оттенки серого, используя mutool. есть опция для оттенков серого, convertно я не знаю, как ее запустить, нет документации, вот что я пытаюсь запустить

$ mutool convert colorspace=gray input.pdf output.pdf 

но это не работает, это просто показывает документацию, как показано ниже

$ mutool convert mutool convert version 1.10a Usage: mutool convert [options] file [pages] -p - password  -A - number of bits of antialiasing (0 to 8) -W - page width for EPUB layout -H - page height for EPUB layout -S - font size for EPUB layout -U - file name of user stylesheet for EPUB layout  -o - output file name (%d for page number) -F - output format (default inferred from output file name) cbz, pdf, png -O - comma separated list of options for output format  pages comma separated list of page ranges (N=last page)  Common raster format output options: rotate=N: rotate rendered pages N degrees counterclockwise resolution=N: set both X and Y resolution of rendered pages in pixels per inch x-resolution=N: X resolution of rendered pages in pixels per inch y-resolution=N: Y resolution of rendered pages in pixels per inch width=N: render pages to fit N pixels wide (ignore resolution option) height=N: render pages to fit N pixels tall (ignore resolution option) colorspace=(gray|rgb|cmyk): render using specified colorspace alpha: render pages with alpha channel and transparent background  Structured text output options: preserve-ligatures: do not expand all ligatures into constituent characters preserve-whitespace: do not convert all whitespace characters into spaces  PDF output options: decompress: decompress all streams (except compress-fonts/images) compress: compress all streams compress-fonts: compress embedded fonts compress-images: compress images ascii: ASCII hex encode binary streams pretty: pretty-print objects with indentation linearize: optimize for web browsers sanitize: clean up graphics commands in content streams garbage: garbage collect unused objects or garbage=compact: ... and compact cross reference table or garbage=deduplicate: ... and remove duplicate objects 
3

1 ответ на вопрос

3
Salal Aslam

После некоторой игры я обнаружил, что мне нужен -Oатрибут, colorspace=grayа также -oдля выходного файла, как это

$ mutool convert -O colorspace=gray -o output.pdf input.pdf 

было бы неплохо, если бы разработчики добавили (обязательно) к элементам, которые необходимы в документации, как это может быть

-o - output file name (required) 

Похожие вопросы