Skip to content

msen7437/import_pdf_images_to_markdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Script to automatically paste pdf pages as images to a markdown file

Dependencies:

  • Python 3

  • pdf2image module

    $ pip install pdf2image
    
  • Poppler PDF-Engine

    $ sudo apt-get install poppler-utils
    • Put bin to environment path

      • change /etc/environment file

        PATH="/usr/bin:/some/other/path:/usr/lib/poppler-utils"
        

Parameters:

-i -> path to the pdf file

-o -> output directory where the images and the markdown file will be dumped in

-f -> filename of the markdown file

-n -> namescheme for the images

  • Images will be named <namescheme>1.jpg, <namescheme>2.jpg, ...

-r -> image resolution, default 200. Should be set lower if the pdf file is really big in order to avoid an eviction

Run:

$ python3 import.py -i path/to/file.pdf -o path/to/output/ -f example.md -n imagename

Disclaimer:

  • All images will be dumped into the images folder inside the output directory
  • I was to lazy to do error handling, so make sure all the directories exist
  • Every output file will be generated on its own.
  • Delete all the images in the images folder before running the script again using the same parameters

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages