- imgs2pdf: convert a list of images in one pdf
- obsidian2pdf: convert your obsidian notes in a pdf (works with images)
The Image to PDF Converter (imgs2pdf) is a Python script that converts a collection of JPEG images into a single PDF file. It utilizes the Python Imaging Library (PIL) for image processing and the PyPDF library for PDF merging.
- Converts JPEG images to a single PDF file.
- Resizes images to a uniform size.
- Appends multiple PDF files into a single PDF.
- Clone the repository or download the script.
- Install the required dependencies: Pillow, pypdf.
pip install Pillow pypdf2
- Run the script from the command line with the following parameters:
python imgs2pdf.py -d /path/to/images -n output_filename
- -d or --images-dir: Path to the directory containing JPEG images.
- -n or --out-file-name: Name of the output PDF file (without extension)
After execution, the script will generate a PDF file .pdf in the specified directory.
The Obsidian to PDF Converter (obsidian2pdf) is a Python script designed to convert Obsidian Markdown notes, including embedded images, into a PDF file. It uses the markdown2 library for Markdown to HTML conversion, WeasyPrint for HTML to PDF conversion, and BeautifulSoup for HTML parsing.
- Converts Obsidian Markdown notes to a PDF file.
- Embeds images directly into the PDF.
- Option to specify the main Obsidian vault directory for image search.
- Clone the repository or download the script.
- Install the required dependencies: markdown2, WeasyPrint, BeautifulSoup.
pip install markdown2 WeasyPrint beautifulsoup4
- WeasyPrint needs gtk3 in order to work, thus it is recommended to install it and reboot the machine.
- Windows: download it here
- Linux:
sudo apt-get install libgtk-3-dev
- Run the script from the command line with the following parameters:
python obsidian2pdf.py -np /path/to/obsidian_note.md -op /output/path -mp /main/vault/path
- -np or --obsidian-note-path: Path to the Obsidian Markdown note.
- -op or --output-path: Path where the PDF will be generated.
- -mp or --main-path: (Optional) Main Obsidian vault directory for image search.
After execution, the script will generate a PDF file .pdf in the specified output folder.
If the main-path parameter is not specified, the script will search for images in the same directory as the Obsidian note.