- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2025 02:11 PM - edited 08-26-2025 02:13 PM
Does anyone else have issues printing knowledge articles directly from Employee Center? We have a requirement to be able to print articles from the front-end of Employee Center. I have tried in both my PDI and our company's site and below is what I get. Everything is OOB configuration for Xanadu. The article is just text.
I have seen some solutions recommended on the community but they all require backend access to ServiceNow. We need something that front-end users can use. I would think this would be OOB functionality that doesn't require much setup, but maybe I am missing something.
(It seems to be an issue when printing any page in Employee Center - not just knowledge articles)
Any recommendations are welcome. Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2025 07:32 AM
To close this loop, I opened a support case with ServiceNow. They sent the following solution which fixed the issue in our instance....
Under the EC Theme for the ESC portal, go to the CSS Variables section and add the below code:
@media print {
.sp-page-root { container-type: normal; }
}
Hopefully this works for others, too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
Hi @David Lundy - Can you share more regarding the print widget you coded?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Sure thing! We built a widget that sits on the esc_kb_article_view page above the article body. It opens the page in another browser tab, but without the SN "wrapper" interface; just the HTML of the KB itself. You can then print through the browser as normal.
The trick is appending &sysparm_use_polaris=false" to the URL to prevent the SN interface from loading.
You can remove the sysparm_media=print parameter if you like; it won't hurt anything. It simply removes the title header with Home, Edit, etc. options:
Here's the construction for the widget. There might be a more efficient way to handle it, but this works for us. 😁
Body HTML Template:
<div class="text-right">
<a ng-if="::!c.isMobile"
id="print-article"
class="kb-end-buttons"
target="_blank"
href="/kb_view.do?sysparm_article={{::c.data.number}}&sysparm_stack=no&sysparm_force_row_count=25000&sysparm_media=print&sysparm_use_polaris=false">
<span class="glyphicon glyphicon-print"></span> Print Article</a>
</div>
Client controller
function KBArticleTitleController($scope, $location, spUtil, cabrillo) {
var c = this;
c.isMobile = spUtil.isMobile() || cabrillo.isNative();
}
Server script
(function() {
data.number = ''; // Stores the Knowledge Article Number once found
// Function to search the current URI for the parameters within the "candidates" array
function getArticleParam() {
var candidates = [
'sysparm_article',
'sysparm_article_id',
'sys_kb_id',
'kb_article',
'article_id',
'sys_id' // Removed 'id' from the list
];
// Loop through the "candidates" array to check if any of the parameters exist in the URI and returns the value
for (var i = 0; i < candidates.length; i++) {
var val = $sp.getParameter(candidates[i]);
if (val) return val;
}
return '';
}
// Run the "getArticleParam" function and record its output to the "idOrNumber" variable
var idOrNumber = getArticleParam();
// Initiate new GlideRecord within the "kb_knowledge" table
var gr = new GlideRecord('kb_knowledge');
// Locate KB from the "kb_knowledge" table directly by "sys_id"
// (for KB portal and Employee Center)
if (gr.get(idOrNumber)) {
data.number = gr.getDisplayValue('number') || '';
return;
}
// Locate KB from the "kb_knowledge" table by "number" if "sys_id" was not available
// (for ESC portal with article number in URL)
gr.initialize();
gr.addQuery('number', idOrNumber);
gr.query();
if (gr.next()) {
data.number = gr.getDisplayValue('number') || '';
return;
}
})();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
This is very helpful. Thanks, David. I was able to use that and create my own print widget. Much appreciated.
