2 minutes
Convert different filetypes on Linux

Tools
Input | Output | Befehl | Anwendung |
---|---|---|---|
jpg | convert in.jpg out.pdf | imagemagick | |
txt | pdftotext in.pdf out.txt | pdftotext | |
html | wkhtmltopdf url out.pdf | wkhtmltopdf | |
html | markdown | pandoc in.html -o out.md | pandoc |
wav | flac | ffmpeg -i in.wav out.flac | ffmpeg |
markdown | pandoc in.txt –pdf-engine=xelatex -o out.pdf | pandoc | |
docx | markdown | pandoc -s in.docx -t markdown -o out.md | pandoc |
txt | epub | pandoc in.txt -o out.epub | pandoc |
epub | ebook-convert in.pdf out.epub | calibre | |
docx | soffice –headless –convert-to PDF in.docx | libreoffice |
JSON
jq
: JSON processor
jsonl to json:
jq --slurp . <in.jsonl >out.json
convert jpg to pdf:
- converts all jpg files in the current directory to a single pdf
- needs latex to be installed
pdfjam --a4paper *.jpg
rotates pages 1-2 180 degree:
pdftk input.pdf rotate 1-2south output output.pdf
unite PDFs, PDFs zusammenfügen
pdfunite in_1.pdf in_2.pdf in_n.pdf out.pdf
PDF to JPEG
pdftoppm -jpeg -r 300 input.pdf output
sonst: imagemagick.org
Pandoc
pandoc
: Haskell Tool zum konvertieren von Textdokumenten.
md zu html oder pdf:
zu html
pandoc file.md > file.html
zu pdf
pandoc -s -o file.pdf file.md
Andere Schriftart mit Latex und Pandoc
–pdf-engine=xelatex zum Pandoc-Befehl hinzufügen. In der .md Datei oben im Abschnitt Options ‘font’ definieren:
---
title: "..."
...
font: "Font-Name"
---
Marp - Präsentationen mit Markdown (.md)
Tool für Präsentationen mit Mardown
Installation:
yay -S marp-cli
oder mit
npx
Getting Startet - Grundlagen von Marp
npx @marp-team/marp-cli@latest presentation.md -o output.pdf
Bilder können verlinkt aus dem Internet genommen werden
Für lokale Bilder muss eine Flag hinzugefügt werden
--allow-local-files
npx @marp-team/marp-cli@latest --allow-local-files presentation.md -o output.pdf
XML
xsltproc input.xml -o output
ffmpeg
convert all .webm files into .mp3 files in the current directory:
for i in *.webm; do ffmpeg -i "$i" "${i%.*}.mp3"; done
das Gleiche mit .m4a files:
for i in *.m4a; do ffmpeg -i "$i" -c:v copy -c:a libmp3lame -q:a 4 "${i%.*}.mp3"; done
m4a zu mp3
ffmpeg -i input.m4a -c:v copy -c:a libmp3lame -q:a 4 output.mp3