Every 15 minutes
Combine images in a Drive folder into one PDF
Images you add to your Drive 'To PDF' folder are placed one per page and saved as a single PDF in the same folder.
- Runs
- Every 15 minutes
- Apps
- Google Drive, Google Slides
- AI
- Not needed
- Access
- Drive read+write; Slides write
Send this to your assistant
Create a ClickRuntime automation: every 15 minutes, when there are new images in my Drive 'To PDF' folder, put each on its own slide and save a PDF of them in the same folder.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Field teams photograph receipts, site visits or signed forms on their phones, and the office needs them as one PDF for a client or an expense claim. Combining images by hand means installing tools or emailing photos around.
Dropping the photos into one Drive folder and getting a PDF back is something anyone can do from their phone.
What you get out of it
One PDF from many photos
Site photos or receipts become a single document to send or file.
Works from a phone
Upload to Drive from anywhere; the PDF appears in the same folder.
No extra software
Everything happens in your own Google Drive.
Tidy, consistent pages
Each image gets its own page, scaled to fit.
How it works
What happens, step by step
Every 15 minutes, ClickRuntime checks your To PDF folder for images it hasn't used yet.
It creates a new presentation and places each image on its own slide.
It saves the presentation as a PDF in the same folder.
It remembers which images were used, so they're not added to the next PDF.
Before it runs live
- Connect Google Drive
- Connect Google Slides
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Google Drive and Google Slides steps into one automation
Under the hood
The code that runs this automation
import io
from datetime import date
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaIoBaseUpload
from clickruntime import on_trigger, credentials, http, state, report_fetched
FOLDER = "to-pdf-folder-id"
@on_trigger
def run(event):
drive, done = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False), set(state.get("done") or [])
images = [f for f in drive.files().list(q=f"'{FOLDER}' in parents and mimeType contains 'image/' and trashed=false", orderBy="name",
fields="files(id,name)").execute()["files"] if f["id"] not in done]
report_fetched(len(images))
if not images:
return {"summary": "Nothing new"}
slides = build("slides", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).presentations()
deck = slides.create(body={"title": f"Images {date.today()}"}).execute()["presentationId"]
reqs = []
for i, img in enumerate(images):
drive.permissions().create(fileId=img["id"], body={"type": "anyone", "role": "reader"}).execute()
reqs += [{"createSlide": {"objectId": f"s{i}", "insertionIndex": i}},
{"createImage": {"url": f"https://drive.google.com/uc?id={img['id']}", "elementProperties": {"pageObjectId": f"s{i}"}}}]
slides.batchUpdate(presentationId=deck, body={"requests": reqs}).execute()
pdf = drive.files().export(fileId=deck, mimeType="application/pdf").execute()
drive.files().create(body={"name": f"Images {date.today()}.pdf", "parents": [FOLDER]}, media_body=MediaIoBaseUpload(io.BytesIO(pdf), mimetype="application/pdf")).execute()
for img in images:
drive.permissions().delete(fileId=img["id"], permissionId="anyoneWithLink").execute()
state.set("done", list(done | {i["id"] for i in images})[-2000:])
return {"images": len(images)}FAQ
Common questions
Which image types work?
What order are images in?
Are the original images kept?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Make a personalised pitch deck for each prospect in a CSV
Drop a prospect list in Drive and each prospect gets their own copy of your pitch deck with their name, company and pain point filled in.
See how it worksTranslate any deck you drop in a Drive folder
Decks you put in your Drive 'Translate' folder are copied and every piece of text is translated into Spanish, keeping the original layout.
See how it worksTurn a meeting transcript into a summary deck
When a meeting transcript lands in your Drive folder, a 6-slide summary deck is drafted from your template next to it.
See how it worksKeep exploring
Set up “Combine images in a Drive folder into one PDF” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.