Error handling, logging and new rendering configuration settings for the PDF Converter Service
KB001626
PRODUCT
The PDF Converter SmartObject Service may not render styles and images correctly. These issues are generally caused by:
- Incorrect configuration of Internet Explorer on the K2 server (manual or group policy)
- Incorrect SSL setup
K2 smartforms 1.0.7 introduced the serializeResources and useWebkit service instance settings to resolve rendering issues. Note that these settings are turned off by default for backwards compatibility. The service was also updated with improved error handling and logging.
SmartObject Service Instance Configuration Settings
When using the Save as PDF control with SmartForms, you may need to set one of the following service instance settings to true on the Converter SmartObject Service to address rendering issues:
useWebkit
A rendering mode that uses WebKit to render the web page that is then converted to PDF. This setting is on (set to true) by default and allows you to search contents of the PDF file, which is sometimes necessary when the PDF document is to be signed.
serializeResources
Off by default, when you set this to true, the CSS and images necessary to render the PDF are retrieved and cached to disk. The HTML CSS and image references are adjusted to reference the cached files on the local server. The new HTML is then passed to the PDF Converter Service which generates a PDF from the HTML. Any issues encountered are logged and you can use this log to determine if any actionable issues occured. The log file is located on the K2 server at:
>ProgramData]K2SourceCode.SmartObjects.Services.PdfConverterLogs
Note that this setting has no effect on the URL-based SmartObject service methods (e.g. Create PDF from URL).
warmUpPDFCall
Off by default, when you set this to true, the URL is called before conversion is attempted, which can correct some rendering issues. This setting does not apply to the Save as PDF control or when calling HTML methods directly.
By default, serializeResources and warmUpPDFCall are turned off. Change the settings to true to enable different rendering. See KB001633 K2 smartforms 1.0.7 Known Issues List for known issues when using these settings.
Error Logging
Error logging can be enabled in the dProgram Files]K2 blackpearlHost ServerBinK2HostServer.exe.Config file on the K2 application server:
The error log file is written to the following location:
Program Files]K2ServiceBrokerSourceCode.SmartObjects.Services.PdfConverter.error