Find all directories with the file extension ".pdf", cut the first and second fields of the output, and compress them into a tar file.
find ~ -type d -name "*.pdf" | cut -d/ -f1 -fnc2 | xargs tar -cvzfp