Do you have trouble saving the generated PDF document into a server file location? Currently, K2 has provide an OOB function to generate PDF via their PDF Converter SmartObject. With this, I came out with an assembly to transfer the generated PDF into server file location.
Before we proceed, you may wish to visit Save PDF Control to understand more about the PDF conversion.
WHAT THIS ASSEMBLY DOES?
This assembly helps to transfer the generated PDF and save it into the file location. This should be installed as an endpoint assembly which you will be able to use in both SmartForms and Workflow.
HOW TO INSTALL
Prior to the installation, please download the assembly DLL before your proceed. Extract and copy the DLL into the K2 BlackPearl APP server.
Register the service instance
1. Register the service instance under Endpoints Assembly via SmartObject Tester Tool.
2. Select your authentication mode and specified the path that you have copy the assembly DLL over. Click Next.
3. Rename the system and display name and click Add. (You should be seeing Add button instead of Update button)
Create the Smart Object
1. Create the SmartObject for the newly created assembly
2. Select only SAVEPDFFileToServer Objects and click OK.
3. Success message prompted, click OK.
4. You will see the SmartObject being created as below:
HOW TO USE
After the SmartObject is created using this assembly, you will be able to use it as a normal SmartObject function.
This SmartObject will only works when you generate the PDF document via the PDF Converter SmartObject. Refer to Save PDF Control on how to create the PDF.
The account that is used to run this service instance would require read & write permission to the file/folder path.
Transfer PDF File To Server SmartObject
SmartObject Properties (examples shown in the screenshot):
- HostName – K2 Server Host Name
- PDF_ID – ID that is generated after creating the PDF
- FilePath – Location of the file path
- RemovePDFSMO – set as “True”, if you would like to remove the PDF from the PDF Converter SmartObject
This solution is built and tested on K2 BlackPearl 4.6.11 version. It could not be compatible to other version prior to future K2 software releases.