Blank PDF Generation

Introduction

Recently, I had done a K2 installation containing the K2 BlackPearl & K2 SmartForms components. After the installation, i had faced several issue on the PDF generation that is provide by K2 OOB settings.

Environment Setup

The K2 version that was installed is on 4.6.11.

Server Setup

The server structure is at such:

  • One K2 Application server
  • One K2 Web server
  • One K2 Database Server

K2 Application Server

Application server are install with K2 BlackPearl, K2 SmartForms and K2 SmartForms Control Pack server components.

K2 Web Server

Web server are install with K2 Workspace, K2 Designer, K2 SmartForms Runtime and K2 SmartForms Control Pack Designer & Runtime.

K2 Database Server

Database server contains only K2 database.

K2 SmartForms Setup

As there are few requirements, thus I had created a secondary SmartForms Runtime site. This site is use for PDF Generation purpose. You may refer to here for more info.

The primary SmartForms Runtime site is authenticate using Form Login and the secondary SmartForms Runtime site is authenticate using AD Login.

Issues Encountered

After the installation was done, I had executed the PDF generation via workflow and K2 SmartForms. Following were the issues I had encountered:

  1. Blank PDF Generated
  2. Distorted PDF Generated

These issues happens quite randomly but was not surfaced upon the subsequent PDF generation for a short period of time.

Then I managed to replicate the issue by running an IISRESET command in the web server. Upon every IISRESET, I managed to generate a blank PDF but subsequent PDF generation would work fine.

It seems that there is a session timeout or caching somewhere that seems to prevent the PDF generation from working right.

Resolution

Since I am using AD Authentication via the secondary SmartForm Site, I manage to figure out by tuning the IIS application authentication settings to suit the PDF needs.

1. Open IIS, locate your secondary SmartForm Runtime Site and click on AuthenticationIIS2

2. Set the settings as follows:

IIS

Conclusion

With the above settings, PDF generation is able to work perfectly!

But do take note, this solution will work only if you have a secondary SmartForms Runtime site that is specifically use for PDF generation.

This solution is only tested with 4.6.11 version, it might not work for the rest of other K2 version.

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s