Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
software:pdf [2013/09/19 16:40] 127.0.0.1 external edit |
software:pdf [2025/01/07 22:49] (current) cyril [convert (image magick)] |
||
|---|---|---|---|
| Line 13: | Line 13: | ||
| </ | </ | ||
| + | Compress PDF file containing images (''/ | ||
| + | < | ||
| + | gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ | ||
| + | </ | ||
| ===== PDFTK ===== | ===== PDFTK ===== | ||
| - | Split and merge PDF files: | + | * Split and merge PDF files:< |
| - | < | + | pdftk in.pdf cat 2-4 output out.pdf |
| pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf | pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf | ||
| pdftk A=one.pdf B=two.pdf cat A1-7 B1-5 A8 output combined.pdf | pdftk A=one.pdf B=two.pdf cat A1-7 B1-5 A8 output combined.pdf | ||
| pdftk A=one.pdf B=two.pdf cat A1 B1W output combined.pdf # rotate West B1 (E,N,W,S) | pdftk A=one.pdf B=two.pdf cat A1 B1W output combined.pdf # rotate West B1 (E,N,W,S) | ||
| + | pdftk one.pdf two.pdf shuffle output combined.pdf # shuffle the two files (A1 B1 A2 B2 A3 B3...) | ||
| </ | </ | ||
| - | + | * Encrypt/ | |
| - | Encrypt/ | + | |
| [[http:// | [[http:// | ||
| + | * Rotate:< | ||
| + | pdftk in.pdf cat 1-left 2-down output out.pdf | ||
| + | </ | ||
| + | |||
| + | ===== pdfjam ===== | ||
| + | |||
| + | * split and merge:< | ||
| + | pdfjam file1.pdf ' | ||
| + | </ | ||
| + | * set multiple pages in one:< | ||
| + | pdfjam --nup 2x1 --landscape true --frame false file.pdf | ||
| + | </ | ||
| + | * quickly rotate (pdf90, pdf180, pdf270):< | ||
| + | pdf90 file1.pdf | ||
| + | pdfjam --angle 180 in.pdf out.pdf | ||
| + | </ | ||
| + | * convert image to pdf in A4 format:< | ||
| + | pdfjam --paper a4paper --outfile file.pdf file.jpg | ||
| + | </ | ||
| + | |||
| + | ===== sed ===== | ||
| + | |||
| + | * crop pages (here remove 14% of page height at the bottom):< | ||
| + | sed ' | ||
| + | </ | ||
| ===== convert (image magick) ===== | ===== convert (image magick) ===== | ||
| - | Merge image files into a pdf file: | + | Merge image files into a pdf file (but better use pdfjam for A4 conversion): |
| < | < | ||
| convert page-*.png -page A4 [-rotate 90] test.pdf | convert page-*.png -page A4 [-rotate 90] test.pdf | ||
| + | convert -density 300x300 test.png test.pdf | ||
| + | convert -units PixelsPerInch -density 300x300 -extent 2480x3508 -gravity center -background white test.png test.pdf | ||
| </ | </ | ||
| + | Convert pdf page into image file at resolution 300dpi: | ||
| + | < | ||
| + | convert -density 300x300 test.pdf test.png | ||
| + | </ | ||
| + | |||
| + | Recompress the pages:< | ||
| + | convert -quality 80 page-1.jpg page-1c.jpg | ||
| + | </ | ||
| + | |||
| + | Erase a part of the image (especially useful for batch processing):< | ||
| + | convert page-1.jpg -fill white -draw " | ||
| + | </ | ||
| ===== pdftotext ===== | ===== pdftotext ===== | ||
