2020-09-28 08:57:21 +00:00
|
|
|
|
2020-12-14 10:02:29 +00:00
|
|
|
PDF
|
|
|
|
---
|
|
|
|
|
|
|
|
[pdftk](https://doc.ubuntu-fr.org/pdftk)
|
|
|
|
|
2021-11-20 21:10:27 +00:00
|
|
|
* img > pdf: `convert *.jpg output.pdf`
|
2020-12-14 10:02:29 +00:00
|
|
|
* concat: `pdftk *.pdf cat output tous.pdf`
|
|
|
|
* deconcat: `pdftk input.pdf burst`
|
|
|
|
* deconcat avec prefix: `pdftk input.pdf burst output page_no%d.pdf`
|
|
|
|
* pivot:
|
|
|
|
* 1er page à l'Est mais pas les autres pages :
|
|
|
|
```
|
|
|
|
pdftk input.pdf cat 1east 2-end output sortie.pdf
|
|
|
|
```
|
|
|
|
* toutes les pages au Sud :
|
|
|
|
```
|
|
|
|
pdftk input.pdf cat 1-endsouth output sortie.pdf
|
|
|
|
```
|
|
|
|
* extraction
|
|
|
|
```
|
|
|
|
pdftk input.pdf cat 6 2-5 7-9 output sortie.pdf
|
|
|
|
```
|
2021-11-20 21:10:27 +00:00
|
|
|
* Compression (pour impression) :
|
|
|
|
```
|
|
|
|
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sPAPERSIZE=a4 -dFIXEDMEDIA -dPDFFitPage -sOutputFile=output.pdf input.pdf
|
|
|
|
```
|
2020-09-28 08:57:21 +00:00
|
|
|
|
|
|
|
Images
|
|
|
|
------
|
2021-11-20 21:10:27 +00:00
|
|
|
- Une image
|
|
|
|
```
|
|
|
|
convert -resize 50% image.jpg image.jpg`
|
|
|
|
```
|
2020-09-28 08:57:21 +00:00
|
|
|
|
2021-11-20 21:10:27 +00:00
|
|
|
- En batch
|
|
|
|
```
|
|
|
|
mkdir tmp
|
|
|
|
for i in *.JPG ; do convert -resize 1500 "$i" "tmp/$i" ; done
|
|
|
|
```
|
2020-09-28 08:49:00 +00:00
|
|
|
|
2021-11-11 17:07:10 +00:00
|
|
|
|
|
|
|
Pandoc
|
|
|
|
------
|
|
|
|
|
2021-11-11 17:08:31 +00:00
|
|
|
```
|
|
|
|
pandoc input.md -o output.pdf
|
|
|
|
```
|
2021-11-11 17:07:10 +00:00
|
|
|
|
2021-11-11 17:08:31 +00:00
|
|
|
- Add links and color them:
|
|
|
|
```
|
|
|
|
--reference-links -V colorlinks=true
|
|
|
|
```
|
2021-11-11 17:07:10 +00:00
|
|
|
- don't forget space before list
|