Generate PDF as a formatted page and send email

Chris York
Tera Expert

My goal is to have a easy way to take a record (It happens to be a Purchase Order record in a custom PO table) in ServiceNow and generate a formatted page (including image tags + other html formatting) and then generate a PDF file from that page and then send that PDF file to an email address

Step 1 - Generate a formatted page. I think the best way for this is a custom UI Page.
Step 2 - Create a PDF file for this page (similar to what happens when you export a page to PDF).
Step 3 - Send that PDF file in an email to an external vendor address that is contained on the original PO record in ServiceNow.

Ideally this would all be a one-click operation from the PO record.

Any thoughts or ideas how I could accomplish this requirement?

12 REPLIES 12

bbarnard
Kilo Contributor

I have almost the exact same use case. I'm currently requiring uses to print the custom UI page to PDF via software on their local host (adobe, chrome) but I would prefer to do this in SN but have not found a way to go from UI page straight to PDF yet.


We're looking for the exact same thing. If someone has some example code of a ui page, and would be ok with sharing, that would be of great help. The general structure i'm looking for is:
Header with an image, and banner text
Fields from the PO in a two column fashion
Line items in a table format including name, qty, unit cost, total row cost columns
footer with an authorizing user reference, and a blank line for a signature


Any example would help. Thanks,
Scott


erite123
Kilo Contributor

I need something similar. Thanks...


dunlopr
Kilo Contributor

I need to be able to produce a customised PDF for email or posting from the Procurment Application - a PO to a supplier. Same issue as Scott it seems, I need to include Company details and logo etc. If I can't generate a viable print-out then I'm stuck and all other features within the Procurement Application are sadly irrelevent.

Any examples of how to achieve this - or confirmation that it can or cannot be done will be appreciated.

Robin.