In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article focuses on "how to operate PDF on the Linux command line". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "how to operate PDF on the Linux command line".
The pdftk command provides a number of command-line operations for dealing with PDF, including merging pages, encrypting files, adding watermarks, compressing files, and even repairing PDF.
Although PDF is generally considered to be a fairly stable file, you can do a lot of processing on Linux and other systems. This includes merging, splitting, rotating, splitting into single pages, encryption and decryption, adding watermarks, compression and decompression, and even repairs. The pdftk command can perform all or more operations.
"pdftk" stands for "PDF Toolkit" (PDF tool kit), which is very easy to use and works well with PDF. For example, to merge separate files into a single file, you can use the following command:
$pdftk pg1.pdf pg2.pdf pg3.pdf pg4.pdf pg5.pdf cat output OneDoc.pdf
OneDoc.pdf will contain all five documents shown above, and the command will be run in seconds. Note that the cat option means to connect the files together, and the output option specifies the name of the new file.
You can also extract selected pages from PDF to create separate PDF files. For example, if you want to create a new PDF that contains only pages 1, 2, 3, and 5 of the document created above, you can do the following:
$pdftk OneDoc.pdf cat 1-3 5 output 4pgs.pdf
In addition, if you want pages 1, 3, 4, and 5 (a total of 5 pages), we can use the following command:
$pdftk OneDoc.pdf cat 1 3-end output 4pgs.pdf
You can choose individual pages or page ranges, as shown in the example above.
The next command creates a consolidated document from a file that contains odd pages (1, 3, and so on) and a file that contains even pages (2, 4, and so on):
$pdftk A=odd.pdf B=even.pdf shuffle A B output collated.pdf
Note that the shuffle option enables the integration to be completed and indicates the order in which the document is used. Also note: although the odd / even pages are recommended above, you are not limited to using only two files.
If you want to create an encrypted PDF that can only be opened by recipients who know the password, you can use the following command:
$pdftk prep.pdf output report.pdf user_pw AsK4n0thingGeTn0thing
Option provides 40 (encrypt_40bit) and 128 (encrypt_128bit) bit encryption. 128-bit encryption is used by default.
You can also use the burst option to split the PDF file into a single page:
$pdftk allpgs.pdf burst$ ls-ltr *. Pdf | tail-5 shs shs RW pdf-1 shs shs 22933 Aug 8 08:18 pg_0001.pdf-rw-rw-r-- 1 shs shs 23773 Aug 8 08:18 pg_0002.pdf-rw-rw-r-- 1 shs shs 23260 Aug 8 08:18 pg_0003.pdf-rw-rw-r-- 1 shs shs 23435 Aug 8 08:18 pg_0004.pdf-rw-rw-r-- 1 shs shs 23136 Aug 8 08:18 pg_0005.pdf
At this point, I believe you have a deeper understanding of "the method of operating PDF on the Linux command line". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.