GithubHelp home page GithubHelp logo

converters's Introduction

Format2Format Converters

List of the currently available converters

  • imgs2pdf: convert a list of images in one pdf
  • obsidian2pdf: convert your obsidian notes in a pdf (works with images)

imgs2pdf

Overview

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.

Features

  • Converts JPEG images to a single PDF file.
  • Resizes images to a uniform size.
  • Appends multiple PDF files into a single PDF.

How to Use

  1. Clone the repository or download the script.
  2. Install the required dependencies: Pillow, pypdf.
    pip install Pillow pypdf2
    
  3. 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.

obsidian2pdf

Overview

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.

Features

  • 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.

How to Use

  1. Clone the repository or download the script.
  2. Install the required dependencies: markdown2, WeasyPrint, BeautifulSoup.
    pip install markdown2 WeasyPrint beautifulsoup4
    
  3. 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
  4. 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.

Note

If the main-path parameter is not specified, the script will search for images in the same directory as the Obsidian note.

converters's People

Contributors

projectoofficial avatar

Stargazers

Mattia Bernardi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.