Renders the HTML you paste in as a PDF, downloads the finished file and emails it to you as an attachment.
Uses
Gmail
PDF.co
Turn HTML into a PDF document
Give it the HTML for a page, a name for the file and an address, and run it whenever you have markup to turn into a document. The HTML is rendered as a PDF exactly as you wrote it, the finished file is downloaded, and it is emailed to you as an attachment.
You get an email with the PDF attached, its subject the file name you chose. No AI reads the HTML and nothing is summarised, reformatted or tidied up: what you put in is what comes out, styling and all, though any images or stylesheets the page links to must be reachable on the public web. The renderer hands back a short-lived download link rather than the file, so the PDF is downloaded straight away and that copy is attached. If no link comes back or the download fails, the run stops and nothing is emailed, so you never get a message claiming a PDF that is not there. A download failure is reported with the reason but never the address, because that link carries a signature.
htmlSource to blank.Set htmlSource to blank.pdfFileName to blank.Set pdfFileName to blank.sendTo to blank.Set sendTo to blank.pdfFileName and save it as fileName.Trim pdfFileName and save it as fileName.fileName doesn't end with .pdf (ignoring case)If fileName doesn't end with .pdf (ignoring case)fileName to fileName.pdf.Change fileName to fileName.pdf.rendered.Turn HTML into a PDF. Save it as rendered.
File name: fileNamehtmlSourcerendered.url and save it as pdfUrl.Trim rendered.url and save it as pdfUrl.pdfUrl doesn't start with https://If pdfUrl doesn't start with https://fetched to blank.Set fetched to blank.downloadProblem to blank.Set downloadProblem to blank.downloadErrorIf a step below fails, save the error as downloadErrorpdfUrl and save it as fetched.Fetch pdfUrl and save it as fetched.downloadError.message and save it as rawReason.Trim downloadError.message and save it as rawReason.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.safeReason contains ://If safeReason contains ://downloadProblem to the finished PDF could not be downloaded.Change downloadProblem to the finished PDF could not be downloaded.downloadProblem to safeReason.Change downloadProblem to safeReason.downloadProblem is empty and fetched.ok isn't yesIf downloadProblem is empty and fetched.ok isn't yesdownloadProblem to the renderer answered with status fetched.status.Change downloadProblem to the renderer answered with status fetched.status.downloadProblem isn't emptyIf downloadProblem isn't emptydownloadProblem.Stop and report a problem: The PDF was rendered but could not be downloaded, so nothing was emailed: downloadProblem.fetched.body.documents[0].document_ref and save it as documentRef.Trim fetched.body.documents[0].document_ref and save it as documentRef.documentRef doesn't start with doc_If documentRef doesn't start with doc_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.fileName.Show in the output: Emailed fileName.