This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice. This article is not considered official documentation for K2 software and is provided "as is" with no warranties.
When trying to execute a SaveAsPDF control on a view or a form the following error will be presented:
The PDF could not be saved.
Message: Could not find a SmartObject named: PDFFile. Primary Credentials Not Authenticated. Session Not Authenticated.
Method Name: ExecuteSaveAsPDFMethod Module Scope
Name: SourceCode.Forms.Controls.Web.dll Declaring Type
Full Name: SourceCode.Forms.Controls.Web.SaveAsPDFRequest
at SourceCode.Forms.Controls.Web.SaveAsPDFRequest.ExecuteSaveAsPDFMethod(SaveAsPDFRequest request)
at SourceCode.Forms.Controls.Web.SaveAsPDFHandler.ProcessRequest(HttpContext context)
This will prevent generation of any PDF on the environment.
The main reason why this error is raised is due to an invalid username and password as per K2 product design utilizing SQLUM Authentication.
The PDFConverter Service instance does not get updated when the K2 SQLUM Service account password is changed.
Important! K2 Database access will be needed to get the required information
- Validate that the password of the connectionstring for the PDFConverter Service instance in the K2 Database is correct.
--K2 Five and up
SELECT *FROM [SmartBroker].[ServiceInstance] where Name = 'PDFConverterService'
- Validate the SettingKeysXML and confirm if the smoConnectionString is correct.
<key name="smoConnectionString" isrequired="true">Integrated=True;IsPrimaryLogin=True;Authenticate=True;EncryptedPassword=False;Host=localhost;Port=5555</key>
<key name="useWebkit" isrequired="true">true</key>
<key name="serializeResources" isrequired="true">false</key>
<key name="Type Mappings" isrequired="false"><object type="SourceCode.SmartObjects.Services.ServiceSDK.Objects.TypeMappings"><typemappings/></object></key>
After the confirmation of the username and password you will need to update the PDF connection string in the PDFConverter service instance.
To do this you will need to alter the ConnectionString as per the example below:
Example of the Connection string:
Note that the connection string is masked but you can update this as the connection string will be encrypted after this has been updated.
Example of the updated PDFConverter Service Instance:
- After this is completed, please perform a refresh of the PDFConverter service instance to ensure that PDFs will generated going forward.