Skip to main content


 

Symptoms


When a user uploads an image via the image attachment control and subsequently a pdf is made, the uploaded image is not rendered in the PDF.
 

Diagnoses


The issue here is the image used in the Image Attachment control does not get loaded into the form as the form is projected through webKit. This is expected as webKit is effectively opening the form in a private browser for the service account so that it can take a snapshot of it and as such we wouldn't expect data that is unsaved and came directly from the client machine to appear on the form.
 

Resolution

By setting the Converter Service to use SerializedResources the service uses the locally cached form (which contains the image) to build the PDF.

That change can easily be done by editing the service instance within the SmartObject Service Tester.




 

If that does not work you can:

  1. Find the Web.config file in the Smartforms Runtime folder (eg: C:Program FilesK2K2 Smartforms Runtime)
  2. Edit the file and find "Forms.Controls.SaveAsPDF.BaseURL" (or add the key under <appSettings> as per point 4)
  3. Uncomment it (removing <!-- and -->) from the begining and end of that line
  4. Update the value to "https://YourWebSite/Runtime/" so that it looks like:
    <add key="Forms.Controls.SaveAsPDF.BaseURL" value="https://k2.denallix.com/Runtime/"/>
    I used k2.denallix.com as the website in that example.
  5. Find the last </location>
  6. Under under that add:
  7. <location path="Runtime/File.ashx">
      <system.web>
        <authorization>
          <allow users="*" />
        </authorization>
      </system.web>
      <system.webServer>
       <security>
          <authorization>
            <add accessType="Allow" users="K2Service" />
          </authorization>
        </security>
      </system.webServer>
    </location>
  8. Note: K2Service should be the K2 Service user. Eg: DomainK2ServiceUser
  9. Save the changes and restart IIS

Reply