![enscript를 사용하여 ps 파일 대신 pdf 파일을 생성하는 방법은 무엇입니까?](https://linux55.com/image/11296/enscript%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20ps%20%ED%8C%8C%EC%9D%BC%20%EB%8C%80%EC%8B%A0%20pdf%20%ED%8C%8C%EC%9D%BC%EC%9D%84%20%EC%83%9D%EC%84%B1%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95%EC%9D%80%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
다음이 pdf 파일 대신 ps 파일을 생성하는 이유를 알고 싶습니다. 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
cup-pdf를 설치했습니다.
sudo apt install cups-pdf
답변1
기본적으로 enscript
Postscipt 파일(ps)만 생성됩니다.
명령줄에 두 개의 플래그가 없습니다:작은 -p
그리고수도 -P
. 명령줄은 다음과 같아야 합니다.
enscript -B -P <PDF_PRINTER_NAME> 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 프린터를 사용하는 경우 다음과 유사한 명령을 실행하면 ps 파일 대신 pdf 파일이 출력됩니다.
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.