我想知道为什么下面的文件生成一个ps文件而不是pdf文件?我如何使它生成一个pdf文件?谢谢。
$ enscript -B -PPDF code/bloom.c -o bloom.pdf
[ 2 pages * 1 copy ] left in bloom.pdf
$ file bloom.pdf
bloom.pdf: PostScript document text conforming DSC level 3.0我已经安装了cups
sudo apt install cups-pdf发布于 2018-09-20 18:40:10
默认情况下,enscript只生成postscipt文件(ps)。
命令行缺少两个标志:小-p和大写-P。命令行必须如下所示:
enscript -B -P code/bloom.c -p myfile.ps据enscript 命令页说
-P name, --printer=name
Spool the output to the printer name.
-p file, --output=file
Leave the output to file file. If the file is `-', enscript sends the output to the standard output stdout.如果系统中没有pdf打印机,那么幽灵脚本可以将ps文件转换为pdf文件,如下所示:
sudo apt install ghostscript
ps2pdf myfile.ps myfile.pdf或
enscript file -o - | ps2pdf - output.pdf如果pdf打印机在系统中是默认的,那么像这样的命令将输出pdf文件而不是ps文件:
enscript -2 -r -j --font=Times-Roman11 --word-wrap --mark-wrapped=arrow '%f' && sleep 2 && evince ~/PDF/_stdin_.pdf
- The `%f` designates the filename parameter.
- The `&& sleep 2 && evince ~/PDF/_stdin_.pdf` commands will wait two seconds for the print job to finish, then run the Evince PDF viewer to display the file _stdin_.pdf you just generated in the user’s PDF subdirectory.https://unix.stackexchange.com/questions/470364
复制相似问题