/Screenshot_PDF-in-Python

Take a screenshot of specific page and make it PDF.

Primary LanguagePython

Norio Kosaka

Overview

Description

  1. capture.py: taking a screenshot
  2. pdf.py: insert the image in the directory to "myfile.pdf" one by one
  3. pdf_loop.py: iteration of the same procedure above to all directories(pdf.py)
  4. img2pdf.py: convert the image to pdf

Demo

I’ll show you the demo usage of this one!

First get all required libraries by pip or easy-install!

and then go to the directory which you want to store the image of screenshots.

Since i have coded for private purpose, please when it comes to actually use, modify the pass or URL to take a screenshot.

I am using

  1. Selenium: to control the web browser automatically
  2. pyautogui: to take a screenshot
  3. opencv: to handle the image data
  4. img2pdf: to convert the image to pdf format
  5. os: to cope with file system efficiently

Depending on your modificaition, the output is displayed as the result like the image below. result

謝辞

中村晃一さん、スライドが少々写ってしまいまして申し訳ございません。 機械学習のスライドと講義を拝聴しまして、大変勉強になりました! 有難うございます。