Linux has a bunch tools for manipulating PDF files in various ways. Although its capabilities are very limited compared to commercial tools, I've found them to be surprisingly sufficient for most cases.
Rearranging pages
Most remedial manipulation involving whole pages can be accomplished with the pdftk package, which on Debian based system is available through apt (sudo apt install pdftk ).
For example, to extract a single page from a pdf:
pdftk input.pdf cat 1 output output.pdf
To extract a range of pages from a pdf:
pdftk input.pdf cat 1-2 output output.pdf
To combine multiple pdfs into one:
pdftk input1.pdf input2.pdf cat output output.pdf
Converting to and from image formats
Converting a PDF to an image, editting the image, and converting back to a PDF is a quick-and-dirty method of making minor edits like redactions (blacking out certain texts). Actually, for redactions, I prefer this method because I know that the original text is not buried in the file's metadata somewhere.
Obviously, this method flattens the entire file (and its text) to an image, and therefore some automated systems may reject it. However, if the ultimate recipient is a human being, he/she will likely not realize it... they won't be able to copy/paste text, but you can blame that on some technical glitch if they complain.
To accomplish this, install the img2pdf (sudo apt install img2pdf or similar).
To convert an img to pdf (full size):
img2pdf --pagesize letter -o output.pdf input.png
To convert portrait-ratio png to portrait pdf with 1 inch margin:
img2pdf --pagesize letter --imgsize 7.5inx10in -o output.pdf input.png
convert landscape-ratio png to landscape pdf with 1 inch margin:
img2pdf --pagesize letter^T --imgsize 10inx7.5in -o output.pdf input.png
To convert pdf to png with 300dpi (meaning a 11x8.5 inch (letter sized) pdf would result in 3300x2550 pixels):
convert -density 300x300 input.pdf output.png
Editing Text in PDFs
When it is insufficient to edit PDF's by converting to/from PDF's, you can use libreoffice (or whatever it's called when you read this post). Yes, I was surprised by this capability too:
liberoffice whatever.pdf
However, I'm not sure if edits made with libreoffice would withstand forensic analysis (in case you are trying to accomplish something naughty), so beware.
Extracting Text from PDFs
To extract text from a PDF file, you can use pdftotext from the popplerutils package.
pdftotext file.pdf # outputs file.txt
Whether or not this command produces sane output is a complete crapshoot. Paragraphs and text blocks displayed in a certain order in a rendered PDF file may bear little resemblance to how it is stored internally. And all bets are off when the PDF contains tables and other fancy arrangements of text. Be prepared to do some significant text processing afterwards.