How can you show Office files in knowledge articles


Description

Is it possible to add an Office file like PowerPoint or Word, directly to a knowledge article so it displays inline?

Resolution

There is no out-of-the-box solution for this but there's a manual way you can achieve this. First you need to configure the instance:

1) Install Document Viewer plugin, so the browser can display the content inline: https://docs.servicenow.com/bundle/paris-platform-user-interface/page/use/using-forms/concept/Documentviewer.html
2) Inclusion list iframe src attribute by updating HTMLSanitizerConfig: https://docs.servicenow.com/bundle/paris-platform-administration/page/administer/security/concept/c_HTMLSanitizer.html

When creating an article, you need to follow these steps:

1) Create a new knowledge article
2) Upload the PDF as an attachment
3) Save the article
4) Copy the attachment URL. Something like this: /$viewer.do?sysparm_stack=no&sysparm_sys_id=a3a2a7fadbb030103f261cd74b9619e9
5) In the rich-text editor, go to Source Code
6) Manually enter this code:

<p><iframe src="/$viewer.do?sysparm_stack=no&sysparm_sys_id=a3a2a7fadbb030103f261cd74b9619e9" width="100%" height="500px"></iframe></p>

7) Save and publish.