Install software:
Sudo aptitude install ghostscript
Then run the following command:
GS-dnopause-dbatch-sdevice = write-dcompatibilitylevel = 1.4-d1_settings =/screen -soutputfile1_new_file1_original_file1 _
Parameter description:/screen-output with the lowest precision, because the accuracy required for screen display is very low.
/Ebook-Medium-precision output
/Printer and/Prepress-both indicate high-precision output. Because printing requires high accuracy, the file size is also the largest, or even exceeds the size of the original file.
A large amount of log information is generated during the conversion process. To keep the screen quiet, use the "-Q" parameter.
Use the following command to merge two PDF files:
GS-Q-dnopause-dbatch-sdevice = paiwrite -soutputfile?foo=- F foo1.pdf foo2.pdf
Use the following command to split the PDF file:
GS-Q-dnopause-dbatch-sdevice = paiwrite -soutputfile?foo=- dfirstpage = 2-dlastpage = 3 input #
Only the second to third pages are split.