I'm a newbie using Python, i would like to use python PyAutoGui to do the below steps:
- take a screenshot
- save the screenshot as PNG into a PDF
- click on next page
- repeat step 1 to 3 and keep append the PNG file into the same PDF for 5 times
Hope someone can help me to amend my script. Thank you.
import pyautogui
from PIL import Image
#Take Screenshot.
my_screenshot = pyautogui.screenshot()
screenshot_path = r'C:\Users\Eve\Desktop\test\SS.png'
my_screenshot.save(screenshot_path)
image_1 = Image.open(screenshot_path)
im_1 = image_1.convert('RGB')
#save screenshot into pdf and append the other screenshot into the same pdf.
pdf_path = r'C:\Users\Eve\Desktop\test\New PDF.pdf'
im_1.save(pdf_path)
#Move mouse to click on next page to screenshot
pyautogui.moveTo(1333,657, duration=1)
pyautogui.click(1333,657, duration=1)