How shall I generate a pdf file instead of a ps file using enscript?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite












I was wondering why the following generates a ps file not a pdf file?
How can I make it generate a pdf file? Thanks.



$ 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


I have already installed cups-pdf by



sudo apt install cups-pdf









share|improve this question























  • You might want to pipe the output to ps2pdf.
    – Mark Plotnick
    47 mins ago














up vote
4
down vote

favorite












I was wondering why the following generates a ps file not a pdf file?
How can I make it generate a pdf file? Thanks.



$ 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


I have already installed cups-pdf by



sudo apt install cups-pdf









share|improve this question























  • You might want to pipe the output to ps2pdf.
    – Mark Plotnick
    47 mins ago












up vote
4
down vote

favorite









up vote
4
down vote

favorite











I was wondering why the following generates a ps file not a pdf file?
How can I make it generate a pdf file? Thanks.



$ 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


I have already installed cups-pdf by



sudo apt install cups-pdf









share|improve this question















I was wondering why the following generates a ps file not a pdf file?
How can I make it generate a pdf file? Thanks.



$ 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


I have already installed cups-pdf by



sudo apt install cups-pdf






pdf ps printing cups enscript






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago

























asked 1 hour ago









Tim

23.3k66228411




23.3k66228411











  • You might want to pipe the output to ps2pdf.
    – Mark Plotnick
    47 mins ago
















  • You might want to pipe the output to ps2pdf.
    – Mark Plotnick
    47 mins ago















You might want to pipe the output to ps2pdf.
– Mark Plotnick
47 mins ago




You might want to pipe the output to ps2pdf.
– Mark Plotnick
47 mins ago










1 Answer
1






active

oldest

votes

















up vote
5
down vote













According to enscript manpage



  • by default, enscript only makes postscipt file*.

From The Command Line. It looks like your command is missing the flag -p :



enscript -B -PPDF code/bloom.c -p myfile.ps


You can then convert the ps file to pdf with ghostscript:



sudo apt install ghostscript
ps2pdf myfile.ps myfile.pdf


or



enscript file -o - | ps2pdf - output.pdf


You have to set your default Printer in the system to the PDF printer, so enscript will then send all output to a PDF file. If it is not the default. then the output will be a postscipt file. I would then use something like this command:



enscript -2 -r -j --font=Times-Roman11 --word-wrap --mark-wrapped=arrow '%f' && sleep 2 && evince ~/PDF/_stdin_.pdf


Command explanation:



The `%f` designates the filename parameter. To make it work in the [Geany editor][3], I’ve found that it must be typed in single quotes. 
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.





share|improve this answer






















  • Thanks. Why does -PPDF not make it create pdf file directly? Is it the case on your linux?
    – Tim
    36 mins ago











  • Kindly see the edits ;-)
    – Goro
    34 mins ago










  • How would you " set your default Printer in the system to the PDF printer"? Does -PPDF already specify the printer to be the PDF printer?
    – Tim
    33 mins ago











  • in order to make the PDF printer default, go to the printer configurations GUI for example you installed cups-pdf. You can choose it as a default from the GUI
    – Goro
    30 mins ago











  • Is there a reliable command which will work in both cases with or without making the PDF printer default?
    – Tim
    28 mins ago










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f470364%2fhow-shall-i-generate-a-pdf-file-instead-of-a-ps-file-using-enscript%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
5
down vote













According to enscript manpage



  • by default, enscript only makes postscipt file*.

From The Command Line. It looks like your command is missing the flag -p :



enscript -B -PPDF code/bloom.c -p myfile.ps


You can then convert the ps file to pdf with ghostscript:



sudo apt install ghostscript
ps2pdf myfile.ps myfile.pdf


or



enscript file -o - | ps2pdf - output.pdf


You have to set your default Printer in the system to the PDF printer, so enscript will then send all output to a PDF file. If it is not the default. then the output will be a postscipt file. I would then use something like this command:



enscript -2 -r -j --font=Times-Roman11 --word-wrap --mark-wrapped=arrow '%f' && sleep 2 && evince ~/PDF/_stdin_.pdf


Command explanation:



The `%f` designates the filename parameter. To make it work in the [Geany editor][3], I’ve found that it must be typed in single quotes. 
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.





share|improve this answer






















  • Thanks. Why does -PPDF not make it create pdf file directly? Is it the case on your linux?
    – Tim
    36 mins ago











  • Kindly see the edits ;-)
    – Goro
    34 mins ago










  • How would you " set your default Printer in the system to the PDF printer"? Does -PPDF already specify the printer to be the PDF printer?
    – Tim
    33 mins ago











  • in order to make the PDF printer default, go to the printer configurations GUI for example you installed cups-pdf. You can choose it as a default from the GUI
    – Goro
    30 mins ago











  • Is there a reliable command which will work in both cases with or without making the PDF printer default?
    – Tim
    28 mins ago














up vote
5
down vote













According to enscript manpage



  • by default, enscript only makes postscipt file*.

From The Command Line. It looks like your command is missing the flag -p :



enscript -B -PPDF code/bloom.c -p myfile.ps


You can then convert the ps file to pdf with ghostscript:



sudo apt install ghostscript
ps2pdf myfile.ps myfile.pdf


or



enscript file -o - | ps2pdf - output.pdf


You have to set your default Printer in the system to the PDF printer, so enscript will then send all output to a PDF file. If it is not the default. then the output will be a postscipt file. I would then use something like this command:



enscript -2 -r -j --font=Times-Roman11 --word-wrap --mark-wrapped=arrow '%f' && sleep 2 && evince ~/PDF/_stdin_.pdf


Command explanation:



The `%f` designates the filename parameter. To make it work in the [Geany editor][3], I’ve found that it must be typed in single quotes. 
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.





share|improve this answer






















  • Thanks. Why does -PPDF not make it create pdf file directly? Is it the case on your linux?
    – Tim
    36 mins ago











  • Kindly see the edits ;-)
    – Goro
    34 mins ago










  • How would you " set your default Printer in the system to the PDF printer"? Does -PPDF already specify the printer to be the PDF printer?
    – Tim
    33 mins ago











  • in order to make the PDF printer default, go to the printer configurations GUI for example you installed cups-pdf. You can choose it as a default from the GUI
    – Goro
    30 mins ago











  • Is there a reliable command which will work in both cases with or without making the PDF printer default?
    – Tim
    28 mins ago












up vote
5
down vote










up vote
5
down vote









According to enscript manpage



  • by default, enscript only makes postscipt file*.

From The Command Line. It looks like your command is missing the flag -p :



enscript -B -PPDF code/bloom.c -p myfile.ps


You can then convert the ps file to pdf with ghostscript:



sudo apt install ghostscript
ps2pdf myfile.ps myfile.pdf


or



enscript file -o - | ps2pdf - output.pdf


You have to set your default Printer in the system to the PDF printer, so enscript will then send all output to a PDF file. If it is not the default. then the output will be a postscipt file. I would then use something like this command:



enscript -2 -r -j --font=Times-Roman11 --word-wrap --mark-wrapped=arrow '%f' && sleep 2 && evince ~/PDF/_stdin_.pdf


Command explanation:



The `%f` designates the filename parameter. To make it work in the [Geany editor][3], I’ve found that it must be typed in single quotes. 
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.





share|improve this answer














According to enscript manpage



  • by default, enscript only makes postscipt file*.

From The Command Line. It looks like your command is missing the flag -p :



enscript -B -PPDF code/bloom.c -p myfile.ps


You can then convert the ps file to pdf with ghostscript:



sudo apt install ghostscript
ps2pdf myfile.ps myfile.pdf


or



enscript file -o - | ps2pdf - output.pdf


You have to set your default Printer in the system to the PDF printer, so enscript will then send all output to a PDF file. If it is not the default. then the output will be a postscipt file. I would then use something like this command:



enscript -2 -r -j --font=Times-Roman11 --word-wrap --mark-wrapped=arrow '%f' && sleep 2 && evince ~/PDF/_stdin_.pdf


Command explanation:



The `%f` designates the filename parameter. To make it work in the [Geany editor][3], I’ve found that it must be typed in single quotes. 
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.






share|improve this answer














share|improve this answer



share|improve this answer








edited 19 mins ago

























answered 44 mins ago









Goro

3,21441951




3,21441951











  • Thanks. Why does -PPDF not make it create pdf file directly? Is it the case on your linux?
    – Tim
    36 mins ago











  • Kindly see the edits ;-)
    – Goro
    34 mins ago










  • How would you " set your default Printer in the system to the PDF printer"? Does -PPDF already specify the printer to be the PDF printer?
    – Tim
    33 mins ago











  • in order to make the PDF printer default, go to the printer configurations GUI for example you installed cups-pdf. You can choose it as a default from the GUI
    – Goro
    30 mins ago











  • Is there a reliable command which will work in both cases with or without making the PDF printer default?
    – Tim
    28 mins ago
















  • Thanks. Why does -PPDF not make it create pdf file directly? Is it the case on your linux?
    – Tim
    36 mins ago











  • Kindly see the edits ;-)
    – Goro
    34 mins ago










  • How would you " set your default Printer in the system to the PDF printer"? Does -PPDF already specify the printer to be the PDF printer?
    – Tim
    33 mins ago











  • in order to make the PDF printer default, go to the printer configurations GUI for example you installed cups-pdf. You can choose it as a default from the GUI
    – Goro
    30 mins ago











  • Is there a reliable command which will work in both cases with or without making the PDF printer default?
    – Tim
    28 mins ago















Thanks. Why does -PPDF not make it create pdf file directly? Is it the case on your linux?
– Tim
36 mins ago





Thanks. Why does -PPDF not make it create pdf file directly? Is it the case on your linux?
– Tim
36 mins ago













Kindly see the edits ;-)
– Goro
34 mins ago




Kindly see the edits ;-)
– Goro
34 mins ago












How would you " set your default Printer in the system to the PDF printer"? Does -PPDF already specify the printer to be the PDF printer?
– Tim
33 mins ago





How would you " set your default Printer in the system to the PDF printer"? Does -PPDF already specify the printer to be the PDF printer?
– Tim
33 mins ago













in order to make the PDF printer default, go to the printer configurations GUI for example you installed cups-pdf. You can choose it as a default from the GUI
– Goro
30 mins ago





in order to make the PDF printer default, go to the printer configurations GUI for example you installed cups-pdf. You can choose it as a default from the GUI
– Goro
30 mins ago













Is there a reliable command which will work in both cases with or without making the PDF printer default?
– Tim
28 mins ago




Is there a reliable command which will work in both cases with or without making the PDF printer default?
– Tim
28 mins ago

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f470364%2fhow-shall-i-generate-a-pdf-file-instead-of-a-ps-file-using-enscript%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

Long meetings (6-7 hours a day): Being “babysat” by supervisor

What does second last employer means? [closed]

One-line joke