Save as PDF Control
We can use this control, when we have to
create PDF has a same Form or View
at a particular time when an event is executed.
We can easily create workflow to send a mail with PDF using K2 smart form with save as PDF control.
We are going to create workflow for New Employee Form, Select New Employee Form and Click on Edit.
In Layout section add Save As PDF Control from the control panel as shown in fig and Click Finish.
Now we have “Design Workflow” using same form “New Employee”. Right click on the form & Select Design Workflow.
Check the smart Form is submitted, Select the Form “New Employee” & default name will create for Workflow. If you want you can change the name of workflow. Click “OK”
Drag Send E-mail to Configure & Click Next to Wizard Step
Add to Address Email & Originator name from the Workflow context.
It will open PDF window, Create new data field “PDF ID” with type Integer, and drag field to value. As shown in fig below.
Click "OK".
Now go to File. Save & Deploy the Workflow.
Again go to New Employee Form & Edit, New Employee form -> Rules -> New Employee (Default) – select “Save button is clicked” -> Edit Rule.
Add the below rules from the action.
i) Execute a control’s method. (Select Save PDF method)
-> Click on Configure -> Drag Emp name to File Name. Click Finish.
-> Click on Configure -> Drag Emp name to File Name. Click Finish.
ii) Start a Workflow (Select Employee Workflow)
- > Click on Configure -> Drag Save as PDF to PDF ID. Click Finish.
Finally Click Finish & Right click the Form and Check in New Employee FORM.
Go to Employee list in SharePoint. Add New Item into list & save.
I got the mail with PDF Attachment.
PDF Format will look like below.
Hope its help. :)