- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2019 09:49 AM
Still waiting on some way to natively display .PDF files within a knowledge article. I know there used to be an app on Share that would handle this, but I'm not finding it anymore (and I think it got deprecated). Currently, I'm having my user base convert the .PDFs to .DOCX, then import those documents using the OOB functionality, but the formatting is never perfect. I suspect the same challenges will exist if I have them convert to HTML.
Does anyone have a good solution for this?
Solved! Go to Solution.
- Labels:
-
Knowledge Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2019 11:44 PM
You can use ServiceNow Document Viewer plugin to display PDF in articles.
1. Whitelist iframe tag and src, height, width attributes by updating HTMLSanitizerConfig.
2. Enable ServiceNow Document Viewer plugin. I think this requires additional license.
3. Attach PDF file to your article. Use source code button to open HTML Source code of the article and add iframe tag to display PDF in your article. The sysparm_sys_id parameter is the sys_id of your attachment.
4. Publish your article.
Article will be displayed as shown below.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2019 11:44 PM
You can use ServiceNow Document Viewer plugin to display PDF in articles.
1. Whitelist iframe tag and src, height, width attributes by updating HTMLSanitizerConfig.
2. Enable ServiceNow Document Viewer plugin. I think this requires additional license.
3. Attach PDF file to your article. Use source code button to open HTML Source code of the article and add iframe tag to display PDF in your article. The sysparm_sys_id parameter is the sys_id of your attachment.
4. Publish your article.
Article will be displayed as shown below.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2020 01:15 PM
Rajesh,
This worked great the whole time we were on Madrid, but now that we've upgraded to Orlando all we get is this:
"This document could not be previewed."
with a "Download Document" button that downloads the .PDF, though the download icon in the top left-hand corner leads to a "Requested attachment does not exist" error.
Any thoughts? I've checked the HTMLSanitizer script include and it still has the attributes whitelisted. The Document Viewer plugin is still active. I'm not sure where else to check.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2020 11:25 AM
In case anyone else runs into this issue, turns out the htmlsanitizer script was sanitizing even whitelisted sites. The fix here:
https://hi.service-now.com/kb_view.do?sys_kb_id=13a1cd63db15d810d58ea345ca961998
Basically you can either disable the sanitizer on the KB body field, or use the glide.html.enable_media_sites property to allow individual sites to display .PDFs in-line. The fix should be in an upcoming patch.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2022 10:49 AM
This article is unavailable to me since I am outside your organization. The fix I found to work is:
Resolution
Need to disable the HTML Sanitizer property for the "text" field in KB articles.
In order to do so please follow the steps below in SUBPROD:
- Create a new KB article
- Fill in the Mandatory Fields
- Right click on the header and Click on Save
- Once the KB article is saved
- Right click on the field name which is used to enter knowledge article content. For example OOB the field is labeled "Text"
- Click on Configure Dictionary
- Once in the Dictionary entry click on the attributes tab
- Once in the attributes tab click on NEW
- Once in the Dictionary Attribute New record page. In the Attribute Field please type in: HTML sanitize
- In the value field please type in: False
- Click on Submit . This will return you to configure dictionary page.
- Click Update on that page.
- In the left application navigator please type in cache.do to clear the cache.
- Return to the KB that was used and input your source code replacing the sysID with yours:
//<p><iframe src="$viewer.do?sysparm_stack=no&sysparm_sys_id=beb2722c1baf91904d9b4221f54bcbaa" width="1050px" height="700px"></iframe></p>
<p> </p>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 05:47 PM
i found the same thing , do you solve it ?