There are a number of ways that you can create PDFs on a Linux system. You can use an application like LibreOffice or OpenOffice, or you can take advantage of any of a number of commands that can generate PDFs from text files or from a group of other file formats. There are also a number of ways that you can merge a group of PDFs into a single PDF file.\nWhy PDFs?\nPDF is often the preferred format for files that you need to share with others or archive. This is because PDF is an open file format, which makes sharing these files between diverse systems and devices possible.\nUsing LibreOffice or OpenOffice\nBoth LibreOffice and OpenOffice can export files as PDFs. You can open an existing document or create a new document and export it as a PDF. OpenOffice's Export as PDF\u2026 and LibreOffice's Export As => Export as PDF\u2026 will do what is required to convert your file.\nGenerating PDFs from text files\nThere are also a number of ways that you can create PDFs from text files. The commands below convert a text file to Postscript using vim and then turn the Postscript file into a PDF.\n$ vim testfile.txt -c "hardcopy > testfile.ps | q"\n$ ps2pdf testfile.ps\n\nThe resulting files might look something like these:\n$ ls -l testfile*\n-rw-rw-r-- 1 shs shs 7928 Feb 24 12:46 testfile.pdf\n-rw-rw-r-- 1 shs shs 5864 Feb 24 12:45 testfile.ps\n-rw-rw-r-- 1 shs shs 60 Feb 23 17:26 testfile.txt\n\nGenerating PDFs from html\nAnother option for generating PDFs is to convert html files. You can open an html file in either LibreOffice or OpenOffice and then export it as a PDF.\nAfter opening an html file in OpenOffice, select File and, under that, Export\u2026 and select PDF with the Save as type: option to generate the PDF file.\nAfter opening an html file in LibreOffice, save it in PDF format by using the Export As and Export as PDF\u2026 options.\nJoining PDFs into a single file\nOne of the easiest ways to join a number of PDFs into a single file is to use the pdftk command. You can read more about using this command on an Ubuntu system at linuxhint.com.\nA pdftk command to join a number of PDFs into a single file might look like this:\n$ pdftk recipe-1.pdf recipe-2.pdf recipe-3.pdf recipe-4.pdf recipe-5.pdf cat output recipes.pdf\n\nYou can use a wildcard if your files follow a regular pattern like this:\n$ pdftk recipe-*.pdf cat output recipes.pdf\n\npdfunite\nAnother command that works like pdftl that you can use is the pdfunite tool. As with pdftk, you can either list all of the files on your command line or using a wildcard if the file names follow a reliable pattern.\n$ pdfunite recipe-1.pdf recipe-2.pdf recipe-3.pdf recipe-4.pdf recipe-5.pdf cat output recipes.pdf\n$ pdfunite recipe-*.pdf recipes.pdf\n\nWrap-up\nUsing a word processor application on your Linux system or any of a number of commands, some of which you might have to install, you can easily work with, create or merge PDF files.