Renders the HTML you paste in as a PDF, downloads the finished file and emails it to you as an attachment.

UsesGmailPDF.co

Turn HTML into a PDF document

ValuesSet htmlSource to blank.Set htmlSource to blank.
ValuesSet pdfFileName to blank.Set pdfFileName to blank.
ValuesSet sendTo to blank.Set sendTo to blank.
TextTrim pdfFileName and save it as fileName.Trim pdfFileName and save it as fileName.
Decisions & LoopsIf fileName doesn't end with .pdf (ignoring case)If fileName doesn't end with .pdf (ignoring case)
Yes
ValuesChange fileName to fileName.pdf.Change fileName to fileName.pdf.
No
No steps
PDF.coPDF.coTurn HTML into a PDF. Save it as rendered.Turn HTML into a PDF. Save it as rendered. File name: fileNamehtmlSource
TextTrim rendered.url and save it as pdfUrl.Trim rendered.url and save it as pdfUrl.
Decisions & LoopsIf pdfUrl doesn't start with https://If pdfUrl doesn't start with https://
Yes
Decisions & LoopsStop and report a problem: The HTML was sent for rendering but no PDF download link came back, so nothing was emailed. Check the HTML and try again.Stop and report a problem: The HTML was sent for rendering but no PDF download link came back, so nothing was emailed. Check the HTML and try again.
No
No steps
ValuesSet fetched to blank.Set fetched to blank.
ValuesSet downloadProblem to blank.Set downloadProblem to blank.
Decisions & LoopsIf a step below fails, save the error as downloadErrorIf a step below fails, save the error as downloadError
Try
HTTPFetch pdfUrl and save it as fetched.Fetch pdfUrl and save it as fetched.
On error
TextTrim downloadError.message and save it as rawReason.Trim downloadError.message and save it as rawReason.
TextReplace pdfUrl with the PDF download address in rawReason and save it as safeReason.Replace pdfUrl with the PDF download address in rawReason and save it as safeReason.
Decisions & LoopsIf safeReason contains ://If safeReason contains ://
Yes
ValuesChange downloadProblem to the finished PDF could not be downloaded.Change downloadProblem to the finished PDF could not be downloaded.
No
ValuesChange downloadProblem to safeReason.Change downloadProblem to safeReason.
Decisions & LoopsIf downloadProblem is empty and fetched.ok isn't yesIf downloadProblem is empty and fetched.ok isn't yes
Yes
ValuesChange downloadProblem to the renderer answered with status fetched.status.Change downloadProblem to the renderer answered with status fetched.status.
No
No steps
Decisions & LoopsIf downloadProblem isn't emptyIf downloadProblem isn't empty
Yes
Decisions & LoopsStop and report a problem: The PDF was rendered but could not be downloaded, so nothing was emailed: downloadProblem.Stop and report a problem: The PDF was rendered but could not be downloaded, so nothing was emailed: downloadProblem.
No
No steps
TextTrim fetched.body.documents[0].document_ref and save it as documentRef.Trim fetched.body.documents[0].document_ref and save it as documentRef.
Decisions & LoopsIf documentRef doesn't start with doc_If documentRef doesn't start with doc_
Yes
Decisions & LoopsStop and report a problem: The download did not produce a file, so nothing was emailed. Try running it again.Stop and report a problem: The download did not produce a file, so nothing was emailed. Try running it again.
No
No steps
GmailGmailSend an email to sendTo.Send an email to sendTo. Subject: fileNameAttached is fileName, rendered from the HTML in this workflow's 'htmlSource' step. The markup was converted as written - nothing in it was rewritten or summarised.
ValuesShow in the output: Emailed fileName.Show in the output: Emailed fileName.