save as pdf in linux

7,830

Solution 1

text2pdf - This is the latest version of text2pdf, and offers a number of improvements over version 1.0. As you might be able to guess from the name, text2pdf converts text files to PDF.

http://www.eprg.org/pdfcorner/text2pdf/

Solution 2

For the best way would be to install cups-pdf and add a virtual printer. More information here on Arsgeek

Another way is to Select "Print to File" and select .ps or .pdf

Solution 3

Beside all the *2pdf and *topdf tools you might find in your /usr/bin directory, a "Print to PDF file" should be present in your DE of choice. In KDE, for example, the kprinter applet will do this. The plus side of this approach, is that the formatting has already been taken care of, by the application that you will choose to print from, and you might be able to drive that application from the command line with DBUS (or DCOP).

Solution 4

OpenOffice Word Processor is typically used in GUI form, but it does have an "Export to PDF" feature. See this answer for hints on how to do it in a scripted form for command line use.

Share:
7,830

Related videos on Youtube

Neilvert Noval
Author by

Neilvert Noval

Can I describe myself in C?

Updated on September 17, 2022

Comments

  • Neilvert Noval
    Neilvert Noval over 1 year

    I have seen how simple it is for Mac OS to generate pdf from a document without additional software to install.
    But I am looking for this functionality in Linux.
    One scenario, for example, if I have myDocument.txt that contain an article, how can I convert this into pdf? My next question is, assuming that myDocument.txt is a 3-paged document, will it generate a 3-page continuous pdf and not just 3 separate pdfs?
    Any tools for linux that does this? (GUI is fine, but commandline is preferable)

    • ajreal
      ajreal over 13 years
      there is some tools like html2pdf, ghost script to pdf, but you still need the additional software
    • Matthew Flaschen
      Matthew Flaschen over 13 years
      There are many ways to do this on Linux, including PDF printers. What distribution are you using? There's a very good chance everything you need is in the repository.
  • Neilvert Noval
    Neilvert Noval over 12 years
    in some way, this is helpful to me. I haven't known "Export to PDF" until I read your answer. +1 point for you. Thanks.