Rendering images in PDFs without a secondary runtime site
KB003233
PRODUCT
Introduction
When developing K2 forms, there may be a requirement to save the form as a PDF with images in its attachment controls. The images stored in the attachment controls should render in the PDF that is generated from the Save as PDF control. One solution to this problem is to create a secondary runtime site as outlined here: https://help.k2.com/kb001861.
However, this approach may not be approved by your organization. This article describes the changes that need to be made so that images will render in the saved PDF without creating a secondary runtime site that has been configured with anonymous authentication.
Steps
1. Locate and edit the web.config file from the Smartforms Runtime folder:
e.g. [Install Drive]:%Program Files%K2K2 Smartforms RuntimeWeb.config
2. Search the file for the following text:
Forms.Controls.SaveAsPDF.BaseURL
3. a) If it exists, uncomment the line by removing '<!--' and '-->'
3. b) If it does not exist, add the following line to the <appSettings> section:
<add key="Forms.Controls.SaveAsPDF.BaseURL" value=""/>
4. Edit the value for this key and change it to your runtime site URL:
5. Find the final </location> tag in the config file
6. Under this location tag, insert the following XML into the file:
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
<system.webServer>
<security>
<authorization>
<add accessType="Allow" users="K2Service" />
</authorization>
</security>
</system.webServer>
</location>