PDF Viewing in-line in Knowledge Article in Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2018 02:24 PM
Does anyone have a solution for viewing a PDF in-line in a Knowledge Article in the Portal? I would like to be able to simply view the file content in browser without having to download the file locally.
The following thread provides a solution for viewing PDFs in-line in Knowledge, but it is via an unmaintained Share app and it does not function in Service Portal.
How can I view a PDF inside a KB article?
Does anyone have any ideas? I was considering experimenting with direct HTML embedding, but hoping there may be an established solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2018 02:27 PM
Have you tried direct HTML embedding?
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Mark as correct or like if the solution is correct...
Years upon years of ServiceNow and JavaScript Experience
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-19-2018 02:28 PM
Yes. I have this same question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2019 04:33 PM
This is built from the original FP - Knowledge Inline PDF which is no longer in the Share. I've made a couple updates to the UI Macro kb_view_custom and added a couple UI Policies. If you check the box to Disable PDF download the fields for Attachment link and Display attachments will be cleared and made Read-only. It will also use the #toolbar=0 attribute to remove the PDF toolbar that allows for rotating, downloading, and printing.
NOTE: To make the solution work and not display the error "Failed to load PDF document", the System Property needs to be set to false to allow PDF to display - glide.ui.attachment.force_download_all_mime_types . Description: Forces download of all attachment files. Please check with your System Admin or Security team with regards to changing this property.
Hope this helps,
Dennis
UPDATE: I tested this and it's not showing up in the Portal view, however, I do have a London instance that will show in Portal if I hardcode the html source code to use this:
<p> <embed id="plugin" src="sys_attachment.do?sysparm_referring_url=tear_off&view=true&sys_id=6660e984db272300bcea9444ca9619e2#toolbar=0" type="application/pdf" width="80%" height="800px" name="plugin" /></p>
I'll keep playing and update when I've found a solution.
UPDATED FIX: So of course when you talk Service Portal, it's going to be a page or widget you'll need to clone and tweak. I cloned the KB Article Page widget to KB Article Page Inline PDF with modified HTML and Server side code. Includes same functionality to not display download from PDF toolbar if selected in the article.
Cheers,
Dennis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2019 09:07 AM
Hello Dennis, Would you do me or all of us a huge favor and help us out?
We had built our KB around the in-line PDF and now we are in London and nothing works, especially in the Portal.
I blame myself here, but I am unable to make sense of your instructions or I am just doing some thing wrong...
I imported XML doc you provided and cannot find it anywhere
Any help will be greatly appreciated! Thank you in advance 🙂