Published Aug 6, 2026, 1:30 PM EDT David has been lifelong fan of technology who loves putting his passion into words. A journalist by training, he discovered the power of Unix-like operating systems when learning how to edit video on macOS, back when it was still called Mac OS X, in the mid-2000s. A lover of retrocomputing, he appreciates the vast history of Unix that Linux continues today. David holds a BA in communication from California State University, East Bay. His writing has appeared in Techopedia, TMCnet, The Motley Fool blog network, and HTG's sister publication MUO, among others. If you need to convert or extract parts of a PDF, you might think you need to pay for Adobe Acrobat or use some shady web app. If you're willing to use the command line, either in Linux, macOS, or Windows Subsystem for Linux, you can manage your PDFs for free. pdftotext Convert your PDF to plain text This is a handy utility that converts a PDF to a plain text file. It's part of the poppler-utils package. It will extract the text from a PDF file and stick it in a .txt file. If you don't have poppler-utils installed, you can install it on Debian or Ubuntu with apt: sudo apt install poppler-utils To convert a file, use the pdftotext utility: pdftotext file.pdf file.txt If you don't specify a file name for the output file, it will default to the same file name up to the extension of the original file. You can examine the output file in a pager or a text editor. pdftohtml Convert your PDF to HTML pdftohtml is part of the poppler-utils package and works the same way as pdftotext. It will convert your PDF file to HTML, as the name suggests. Using it on the command line is similar to pdftotext: pdftohtml file.pdf file.html pdfunite Merge PDF files Another utility from Poppler is pdfunite. If you want to merge different PDF files into one document, this is what you would use. Suppose you had two files you wanted to combine into a third PDF. This is how you'd do it with pdfunite: pdfunite file1.pdf file2.pdf combined.pdf The first two files would be the files you wanted to combine, and the third would be the name of the file you wanted to create that merged the two. You can extend this to more than two files: pdfunite file1.pdf file2.pdf file3.pdf combined.pdf pdftoppm Convert PDFs to images You might want to convert a PDF into image files that you can share. Maybe you want to put a single page into your email or in your social media feed. You would use another Poppler utility, pdftoppm, to do this. As the name suggests, the default output format is PPM, but you can use different formats through the command-line options. In this example, I'll use PNG, since it works well across different devices. I want to split up a long PDF, in this case, an open-source introductory statistics textbook, into different image pages so I can post it to social media and impress all my other friends who love introductory stats texts. pdftoppm -png introductory-statistics-2e_-_WEB.pdf test This will convert every page in the PDF to a PNG file, with the prefix "test" on each file. Here's an example of some converted pages: qpdf A versatile PDF tool qpdf is a utility that will transform a PDF file taken as input in certain ways and output to another file. It's commonly installed on a lot of Linux systems already. To install it in a Debian or Ubuntu system, you can install the qpdf package: sudo apt install qpdf One useful thing you can do with qpdf is to extract a range of pages and put them into another document. For example, to excerpt pages 5 to 10 of our textbook: qpdf --empty --pages introductory-statistics-2e_-_WEB.pdf 5-10 -- excerpt.pdf The --empty portion takes the place of the input file. The part that comes after "pages" is a bit tricky. This includes the name of the input file. After the name comes the page range we want to use, in this case, 5-10. Two dashes (--) follow, and then the name of the output file we want to use. I could have written this differently: qpdf introductory-statistics-2e_-_WEB.pdf --pages . 5-10 -- excerpt.pdf If I wanted to just use pages 5 and 10, I could make another change: qpdf introductory-statistics-2e_-_WEB.pdf --pages . 5,10 -- excerpt.pdf Using a comma (,) rather than a dash (-) will request just those two pages. You can also join PDFs using the --pages option: qpdf --empty --pages doc1.pdf doc2.pdf doc3.pdf -- output.pdf You can even combine this with the page numbers mentioned earlier. Suppose you wanted to extract the first three pages from each document. You'd append the page numbers you wanted from each document: qpdf --empty --pages doc1.pdf 1-3 doc2.pdf 1-3 doc3.pdf 1-3 -- output.pdf Another thing you can do with qpdf is "linearize" a PDF, or optimize it for viewing on the Web. A linearized PDF will have its first page load immediately, without loading the rest of the document. This is useful if you're uploading a large document. To linearize a PDF, use the --linearize option: qpdf --linearize big_file.pdf web_friendly.pdf pdfseparate Split PDFs Similar to pdfunite, pdfseparate can split PDF files into their own separate documents. To copy a document with three pages: pdfseparate file.pdf file-%d.pdf The %d format is similar to the C printf command format you'll see in a lot of other places. pdfseparate will replace the specifier with the page number in each output filename. To extract pages 3 through five of the document: pdfseparate -f 3 -l 5 file.pdf file-%d.pdf This would be a more standard syntax than the qpdf program. img2pdf Make a PDF out of your pictures img2pdf, as the name suggests, is a utility for converting images to PDF files. Suppose you had a bunch of JPEG images you wanted to put in a PDF. You can install it on Ubuntu or Debian: sudo apt install img2pdf If you wanted to convert a bunch of your images to a PDF photo album: img2pdf *.jpg -o my_pictures.pdf Above is an example of the command-line output. It'll give warnings and errors depending on the images. Converting PDFs is easy from the command line It's surprisingly easy to manage PDFs from the command line when you take the time to learn. You won't have to depend on Adobe's software anymore. You can convert PDFs like a pro for free.
7 CLI tools that prove you don't need Adobe Acrobat for editing PDFs
Full Article
Original Source
Read the full article at Howtogeek →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.