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.

Issue

Using the Save as PDF control to convert the Smartform to PDF causes the Form to freeze and the PDF is not created.

Symptoms

1. From the Windows Task Manager, it shows high CPU utilization by the ExpertPDF HTML to PDF Engine process.

Image

2. When you forcibly kill the process, the error below appears in the Host Server logs and Sourcecode.SmartObjects.Services.PDFConverter.error file:

"System.Exception: Could not get conversion result header. Data receive timeout.

at ExpertPdf.HtmlToPdf.ImgConverter.GetMetafileFromUrlWithWebKit(String url, ᦔ[]& fonts, ᥱ& htmlParseInfo) at ExpertPdf.HtmlToPdf.PdfConverter.ConvertAndGetPdfDocument(String url, String htmlString, String baseUrl, String internalLinksDocUrl, Boolean fromUrl) at ExpertPdf.HtmlToPdf.PdfConverter.ConvertAndSaveToStream(Stream outStream, String url, String htmlString, String baseUrl, String internalLinksDocUrl, Boolean fromUrl) at ExpertPdf.HtmlToPdf.PdfConverter.GetPdfBytes(String url, String htmlString, String baseUrl, String internalLinksDocUrl, Boolean fromUrl) at ExpertPdf.HtmlToPdf.PdfConverter.GetPdfBytesFromUrl(String url) at SourceCode.SmartObjects.Services.PdfConverter.K2PdfConverter.CreatePDFString() at SourceCode.SmartObjects.Services.PdfConverter.K2PdfConverter.CreatePDF(Property[] inputs, ServiceObject serviceObject) at SourceCode.SmartObjects.Services.PdfConverter.DataConnector.Execute(Property[] inputs, RequiredProperties required, Property[] returns, ServiceObject serviceObject, String methodName) at SourceCode.SmartObjects.Services.PdfConverter.PdfConverterService.Execute()"

Troubleshooting Steps

The issue can occur if any of the following assemblies are of the wrong file version based on your version of K2 installed.

  • Program Files (x86)\K2 blackpearl\Host Server\Bin\epengine.dll
  • Program Files (x86)\K2 blackpearl\Host Server\Bin\ephtmltopdf.dll
  • Program Files (x86)\K2 blackpearl\ServiceBroker\Sourcecode.SmartObjects.Services.PDFConverter.dll

To resolve this, kindly follow these steps:

1. If you have another environment on the same K2 version (including any CU or FP installed) where PDF conversion is working fine, please compare the versions of the above-mentioned assemblies between both environments.

In the absence of a non-issue environment, kindly contact your regional K2 Support Center and provide the results from this query: SELECT * FROM [HostServer].[UpdateHistory]

2. If any discrepancies with the versions are identified, replace the assembly with the correct one from the non-issue environment.

3. Perform a restart of the K2 service. Then, test the PDF conversion again.