In a K2 environment configured with multi authentication and a secondary runtime site, that is set to anonymous authentication, when a form with a view that calls images from a SmartObject in an attachment control is saved to PDF using the PDF control, the images are not rendered in the PDF.
This is caused when the SmartObject call is made to render the images from the secondary runtime site, and the user cannot be authenticated. The multi-authentication setup is unable to use the anonymous user and the call cannot be completed and images are not rendered when the PDF is generated.
- Ensure you have K2 4.7 installed.
- Install the K2 4.7 February 2017 Cumulative Update.
- Get the K2 4.7 February 2017 Cumulative Update FP7 from Regional Support.
- Install the K2 4.7 February 2017 Cumulative Update FP7 to apply the fix.
- Create a Secondary Runtime site with anonymous authentication.
- Test to see if the site can be accessed.
For security reasons it is recommended that you block access to this site for all users in the IIS, except for the Application Pool user.
- Navigate to the main Runtime Site’s web.config file located in [INSTALLDIRECTORY]\k2 smartforms runtime.
- Under the heading <!-- Runtime Links --> add the following entry:
<add key="Forms.Controls.SaveAsPDF.BaseURL" value="https://k2.denallix.com/RuntimeB/"/>
The URL needs to be the URL of the secondary runtime site.
You can use the steps below as an alternative to creating a secondary runtime site:
- Find the Web.config file in [INSTALLDIR]\K2 smartforms Runtime.
- Edit the Web.config file.
- Find the "Forms.Controls.SaveAsPDF.BaseURL" key. If it does not exist, add it under <appSettings> as per step 5 below.
- Uncomment the key entry by removing "<!--" and "-->" from the beginning and end of that line.
- Update the value to "https://[YourWebSite]/Runtime/". The key entry will then be:
<add key="Forms.Controls.SaveAsPDF.BaseURL" value="https://[YourWebSite]/Runtime/"/>
The [YourWebSite] value will be the name of your actual runtime site.
- Find the last </location> and add the following underneath:
<allow users="*" />
<add accessType="Allow" users="K2Service" />
K2Service should be the K2 Service user. For example: Domain\K2ServiceUser
- Save the changes and restart IIS.