Usage
Below are some example commands for using PdfItDown from the terminal, along with explanations for each option and scenario:Convert a single file to PDF
Use this command to convert a single file (e.g., a Markdown file) to PDF and set a custom title in the PDF metadata:-i README.md: Specifies the input file to convert.-o README.pdf: Sets the output PDF file path.-t "README": Sets the PDF title metadata.
Convert multiple files with custom output paths
You can convert several files at once, specifying a matching output PDF for each input:- Multiple
-iflags: List each input file you want to convert. - Multiple
-oflags: Provide an output path for each input file, in the same order.
Convert multiple files with inferred output paths
If you omit the output file paths, PdfItDown will automatically generate PDF filenames based on your input files:- Output files will be named after the input files, with
.pdfextensions.
Bulk convert all files in a directory
To convert every file in a directory to PDF in one go:-d tests/data/testdir: Specifies the directory containing files to convert. All supported files in this directory will be converted to PDF.
For more details on available options, run: