- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 03:25 AM
I need to embed a PDF file for the user to view inside the page in service portal. I have tried the following, and nothing works.
The iframe downloads the atttachment instead of showing it.
<iframe id="inline_document" scrolling="no" style="width:100%;height:900px;border:none" src="sys_attachment.do?view=true&sys_id=bc039edadbe923008fa34410ba9619b3">
</iframe>
The embed gives error saying it can't load the document.
<embed height="200px" src="/sys_attachment.do?sysparm_referring_url=tear_off&view=true&sys_id=bc039edadbe923008fa34410ba9619b3" type="application/pdf" width="200px"/>
The object gives error saying it can't load the document.
<object data="https://elodev.service-now.com/sys_attachment.do?sysparm_referring_url=tear_off&view=true&sys_id=bc039edadbe923008fa34410ba9619b3" type="application/pdf" width="100%" height="50%">
<p>Alternative text - include a link <a href="myfile.pdf">to the PDF!</a></p>
</object>
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2018 02:48 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 03:38 AM
Hello Juliana,
As of my knowledge, the sys_attachment.do does not actually display the attachment, but rather the record itself. In this case it will download it (hence why the download is triggered). However this may help you with your solution:
Greetings
Fabian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2018 04:02 AM
Hi Juliana
There was some talk of the document viewer plugin being enabled to allow attachments to display rather than to download however this seems to have hit some issues
I'm definitely interested in what you come up with as we have a similar use case
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2018 02:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2018 03:54 AM
Nice result, thanks for sharing