![]() We have successfully learned how to read a PDF file as input and display/view it on a Linux command-line window. The final implementation of the above command is as follows: $ pdftotext draft.pdf - | less Our modified syntax for this approach is as follows: $ pdftotext - | less We, therefore, need to temporarily convert the sample PDF file to a text file and then pipe the converted text file to the less command for viewing/display on the Linux terminal window. However, we are not primarily interested in converting our sample PDF file to a text file format. Its usage syntax is as follows: $ pdftotext ] Method 2: Combining pdftotext and less CommandsĪs stated on its naming convention, the pdftotext command utility is primarily effective in converting a PDF file to a text file. $ less draft.pdfĪs expected, the PDF file format is retained. To view our PDF file ( draft.pdf), we will run the following command. In comparison to graphical text editors like vi and nano, less command takes a shorter duration to read and display the targeted file on the Linux terminal window. The GNU General Public License makes it possible to use less utility from the Linux terminal to read input files. Method 1: View PDF File Using less Command Let us break down the approaches to viewing PDF files from a Linux terminal. The preview of the above file is from a graphical PDF reader application installed on a Linux operating system. We are going to need a sample PDF file which we will try to open and view from the Linux operating system command line. For users or Linux administrators bound to a Linux server operating system environment, this approach makes it easy to relatively preview PDF documents like receipts and invoices. Not all Linux users are tied to a Desktop environment where access to a graphical PDF reader application is easy.PDF files are comparatively smaller than other document file formats making it easy for the Linux terminal environment to accommodate them.The syntax for each rule is: Where START and END are positive (1-based) or negative page numbers and ROTATE is one of >, V, or < indicating a clockwise rotation of 90, 180, 270 degrees, respectively. RULE an optional string indicating which pages to extract and rotate. Therefore, viewing such a document from the Linux command line environment should be the same as viewing it from a graphical PDF document reader. PATH a file, directory, or wildcard string (e.g., file.pdf) of files to merge. Once a document is created and saved in a PDF format, it cannot be altered like documents existing in. Why View PDF File in Linux Command Lineīeing able to view a PDF file from the Linux command-line environment is associated with the following benefits. The creation of the PDF or Portable Document Format file type was inspired to solve/lessen the hurdles that made document sharing between operating systems and computers difficult. Please note that this article seeks to explore viable ways of viewing (not opening) a PDF file from the Linux command-line environment.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |