Skip to content

Automatically saves incoming PDF files from your Gmail Inbox and renames them using content in it (using Regex)

License

Notifications You must be signed in to change notification settings

robocrax/pdf-attachment-save-rename-and-print

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bulk save PDF's from Gmail and rename

Using Google Apps Script (free quota) for any incoming mails with matching params and PDF attachment, saves it and optionally renames it by converting PDF to text using OCR and using content in it.

Email is marked as read after script downloads the email to notify user/you. Can also add a label once done if you prefer

For printing

Additionally to automatically print the attachments, I'm using benjamin-kromer's printHotfolder python script idea but using Python 3

Since PDFs are received in random order, and synced using Google Backup and Sync in random order as well, I've added a delay to confirm all files are received then start printing them (not prematurely). Delay of 1-2 minutes should easily be enough unless you are on 2G satellite connection

Requirements

  • Assuming you're a dev (not necessarily Python or Javascript)
  • You have a 3rd party application (like Adobe Reader for PDFs) for print support.
    • Right-click a document and make sure you see a Print option
    • Hint: make sure your 3rd party app is the default and not some other app like Microsoft Edge if you don't see Print option in context menu. If you see the option, you're golden

Compile using Pyinstaller

pyinstaller PrintFolderAndArchive.py -i printer.ico --onefile --hiddenimport pywintypes

About

Automatically saves incoming PDF files from your Gmail Inbox and renames them using content in it (using Regex)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published