Print on both side to save environment
To save papers and be environment-friendly, whenever possible: - we should print in black and white mode instead of color mode, as the latter is much expensive. - we should print on both sides.
Sometimes, we have many pdfs or images which has only one page or odd-number pages. To save paper, we can convert images to pdfs, them merge all pdfs to one image, then print it on both sides.
Convert multiple images to one PDF then print on both sides
- Use online tools like smallpdf.com/jpg-to-pdf or imagetopdf.com/ to convert multiple images to one pdf.
Merge PDF Files then print on both sides
- Install command line tool: pdftk
sudo apt-get install pdftk
- Merge PDF Files
pdftk file1.pdf file2.pdf fiel3.pdf cat output outputfile.pdf
Copy all files into one folder
Before the above steps, we may want to copy all files into one folder, so we can easily convert all or related images together to pdf, and merge all pdfs into one pdf.
we also want to preserve directory names in new filename.
here is the script from superuser
Where:
- %P tell find to omit the leading ./;
- \0 tell find to print the paths using the ASCII NUL character as separator (this should avoid problems with strange names);
- -d $'\0' tell bash to use the proper delimiter for reading the paths;
- ${i////_} tell bash to replace every occurrences of / with _ in the path.