ServiceNow - Embedding a PDF within a Knowledge Article


Introduction

Content for knowledge articles should primarily be written out within the content panes of the knowledge article form.

However, there are times where it is helpful and/or expedient to embed a PDF in a viewer within the knowledge article, so that customers can view the document right from the knowledge article. E.g. Embedding vendor documentation.

Note:

  1.  For Accessibility purposes, always include a link to your attached PDF.
  2. Embedding PDFs should not be used as a replacement for entering direct content into the knowledge article.

Instructions

  1. Attach the PDF to the knowledge article form using the paperclip icon in the main toolbar.

    Paperclip Icon

  2. In the editor toolbar of the field where you want to embed the PDF, click the Source Code button.

    Source Code Button

  3. Paste in the following code to create an iFrame.

    <p>
    <iframe id="inlineFrameExample" style="width: 600px; height: 800px;" title="Inline Frame Example" src="/$viewer.do?sysparm_stack=no&amp;sysparm_sys_id=dfc45e281b2aa5145c5ccbf2604bcb76"></iframe>
    </p>
    


  4. Find the sys_id of the PDF by clicking the [View] link at the top of the knowledge article record. A viewer will open, and you can grab the sys_id from the link in that window.

    PDF Sys ID

  5. Replace the sys_id in the link with the one assigned to the attachment PDF.

    Replace Sys ID


    <p>
    <iframe id="inlineFrameExample" style="width: 600px; height: 800px;" title="Inline Frame Example" src="/$viewer.do?sysparm_stack=no&amp;sysparm_sys_id=add18da493284e18cdffbf6a7bba10b7"></iframe>
    </p>


  6. Your PDF will now be displayed within a frame on your knowledge article. See example below.
    Note: You may want to adjust the default height and width values. The max width that should be used is 700 pixels, to ensure that the frame fits on the Portal.




    KM Utah PDF