No ratings

Rendering images in PDFs without a secondary runtime site


Rendering images in PDFs without a secondary runtime site




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:

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. 




1. Locate and edit the web.config file from the Smartforms Runtime folder:

e.g. [Install Drive]:\%Program Files%\K2\K2 Smartforms Runtime\Web.config 

2. Search the file for the following text:



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:

<add key="Forms.Controls.SaveAsPDF.BaseURL" value=""/>

5. Find the final </location> tag in the config file

6. Under this location tag, insert the following XML into the file:

<location path="Runtime/File.ashx">
            <allow users="*" />
                <add accessType="Allow" users="K2Service" />
7. Save the Web.config file and perform an IIS reset.


Labels: (2)
Version history
Last update:
‎03-16-2022 02:10 AM
Updated by: