PDFTK

    Example

    # concat specific pages
    pdftk A=doc1.pdf B=doc2.pdf cat A1-4 A5 B1-end A6 output out.pdf
    
    # concat all pages
    pdftk doc1.pdf doc2.pdf cat output out.pdf
    

    Remove password from pdf file

    pdftk input.pdf output output.pdf user_pw PWD