app.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import pyautogui from PIL import Image # Taking Screenshot takeScreenshot = pyautogui.screenshot() # The path of Screenshot and r' is used for specifying raw string screenshotPath = r'screenshot.png' # Saving the screenshot in the given Path takeScreenshot.save(screenshotPath) # Opening image open_image = Image.open(screenshotPath) convert_image = open_image.convert('RGB') # Output Pdf Path outputpdfPath = r'output.pdf' # Saving the pdf open_image.save(outputpdfPath) |