Convert manuals (man) to PDF

Many of the users of GNU / Linux When we want to know how a program works, review its options, or simply read its documentation, we make use of MAN.

MAN It is the pager or viewer of manuals of the System, and in general each program that we install includes its electronic manual which we can see with this application. Its use is very simple, we just have to put the command in the terminal:

$ man [aplicación]

Replacing [application] with the name of the program. For example, if we want to see the documentation or manual of MAN itself, we put:

$ man man

And we will get something like this:

MAN You have many options to explore the manuals and their sections, but this post is not to explain how it works. So far everything is very nice.

But we can read these manuals in a more comfortable way simply by taking them to format PDF. How do we do it? Well, very simple:

man -t man | ps2pdf - > man.pdf

This should be enough. However, for certain versions of Acrobat Reader, you need to replace ps2pdf for these:

ps2pdf12 - Convert PostScript to PDF 1,2 (Acrobat 3 and later supported) using ghostscript
ps2pdf13 - Convert PostScript to PDF 1.3 (Acrobat 4 and later compatible) using ghostscript
ps2pdf14 - Convert PostScript to PDF 1.4 (Acrobat 5 and later compatible) using ghostscript

Ready. We can now take our manuals wherever we want 😀


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   auroszx said

    Very interesting, I'll try it with a pair of man's 🙂

  2.   mosquera said

    Very interesting, I had already seen it a couple of times but I always forget it hahahaha. Elav I have changed my Debian testing xfce for KDE hahaha. You were the one who had convinced me to switch to xfce with your contributions after losing gnome2 and not being happy with KDE but now I'm back. You can see the difference in resource consumption but it is very fluid. I just posted this:
    http://galegolinux.blogspot.com.es/2012/08/remastersys-en-wheezy.html
    Maybe someone interests you. By the way, at this rate desdelinux It will become the reference blog on the gnulinuxera topic. Congratulations on the magnificent blog!

    1.    elav said

      Hahaha What can I tell you? Right now I'm between KDE and Xfce… By the way, very good article.

      1.    mosquera said

        Thanks a lot! Yes, I had read that you also used KDE.
        A greeting!

  3.   Oscar said

    Excellent, it looks very practical, to try it said.

  4.   Akari said

    Or you can just look at the man pages in Konqueror, with the "man:" KIO.

    Just put, for example "man: top" to see the man page of "top" in a la mar de majo format.

  5.   Algave said

    Excellent Tip will have to be kept in mind 🙂

  6.   Matias (@ W4t145) said

    I always forget this command. Sometimes it is more comfortable to print than to be reading from the console

  7.   Pablo Andres said

    Very Good Tip. Here goes Another.

    If they only want to send it to a normal file They only do

    man wget> ManWget
    And there they have it in text format more comfortable to read.

  8.   Neo61 said

    Very good all

  9.   miniminime said

    Incredible command, I did not know it but I have already used it xD the thing is ... the command would let us pass everything to pdf if we do the correct pipe or it is only for "man", because if not, we are facing such a tool powerful as

    $ pdftotext
    $ pdftohtml
    $ pdfto *
    $ htmltotext

    That is, a precious inverse that would make us more comfortable for the human eye to see log and texts that become tedious in the xD console

    I have played but as I do not drive excessively I am left with the doubt: S

  10.   Martin said

    I've been using most as a pager for a long time (http://www.slackbook.org/html/file-commands-pagers.html) and the truth that it simplifies my life a lot to read endless man pages. To replace the default pager, look for the most package -it is in all distributions- and add to your ~ / .bashrc:

    export PAGER = / usr / bin / most

    Welcome to a whole new world 😉

  11.   Rabba said

    Does anyone know how to have the man pages in Spanish in arch?

  12.   moskosov said

    Excellent tip Elav, this and Gaara's to convert web pages to .mht have helped me a lot to systematize all the info I have. Thank you!

  13.   rosvel said

    Excellent! thanks for sharing!!

  14.   Pepe Barrascout said

    How great that is, much easier and more comfortable to read the manuals and print them.

    Thanks for sharing the knowledge.

  15.   UserArchlinux said

    Excellent… very useful and productive.
    Greetings and thank you very much.

  16.   userarch said

    Hello,
    test:
    man -t ip link | ps2pdf -> ip-link.pdf
    and it came out:
    `R 'is a string (producing the registered sign), not a macro.
    then i did:
    evidence ip-link.pdf
    Outcome:
    blank document
    could you help me with the problem.
    gracias,