Please note, before getting started, check-in the SmartForm will used to generate the PDF file for.
To generate a PDF file in K2 for a K2 SmartForm, follow the following steps –
1. Select the OOB SmartObject PDF Converter and execute ‘Create PDF From URL’.
K2 Automated Testing Software
BenchQA allows full test automation of K2, including fully automated K2 SmartForms and K2 Workflow testing. It promotes test driven development for K2 and ensures continued quality assurance for K2 solutions. Easily apply changes to test cases to accommodate changes to K2 apps and ensure all apps are regression tested to avoid defects and assure continuous quality.
2. Provide the values for required properties and execute method
• URL String – provide the entire URL that you are attempting to access (https://k2.denallix.com/Runtime/Runtime/Form/Velocity ITBlogs.PDFUsingURL/)
• SmartObject Name – Provide the SMO System name used to create the PDF File (PDFFile)
• SmartObject Method – Method name for Creating PDF File (Create)
• SmartObject File Property Name – Property name used for File in Create method (PDF)
• ID Property Name – Property name used for ID in Create method (ID)
• File Name – Provide any file name for PDF File
• Page Size – A0,A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,ArchA,ArchB,ArchC,ArchD,ArchE,B0,B1,B2,B3,B4,B5,Flsa,HalfLetter,Ledger,Legal,Letter,11×7,Note
• Page Orientation – Portrait, Landscape
• URL Base – Provide base value of URL (https://k2.denallix.com)
• Conversion delay – Provide delay if required in seconds
3. Use the load method of PDF SmartObject to load the PDF file using ID generated as Input value.
4. Finally, the PDF file will be generated
Troubleshooting notes –
1. If you are getting a blank PDF, then it could be due to authentication issue i.e. the K2 service account is not able to access the form. In this case, go to the advance properties of form and set the anonymous access to true and try again.
2. Always check-in the SmartForm used for generating PDF, as it always uses the latest on server not the local one.