Embedding a PDF reader into Storyline
Oct 17, 2017
By
Ian Anderson
Hey,
I need to add a library of 50-odd PDFs into an e-learning module aimed at upskilling our sales team.
I have used the Resources, but that's a bit of a Plan B at the moment.
I would like to embed a PDF reader into the various slides so learners can view the PDF on the same page and not have to go to another tab/page.
My questions are...
- Where do I have to host the PDF source files? (We have pretty strict rules about hosting docs externally.)
- If I need to host them in a folder, does it need to be in the same folder as my .Story file? At the same level? Can it be in a sub-folder?
- What embed code do I need to use to embed the player? (I found a link with various codes here before but now I can't find it for love nor money.)
I think that's all for now, but any help will be hugely appreciated!
Thanks,
Ian
36 Replies
Maybe you can use google drive to slove this problem.
1. upload your pdf files to google drive, then you can generate a link
2. embed the website into storyline
remark: I didn't try this way before, but I guess it can be worked.
Hi Owen,
Thanks for the response.
Unfortunately, due to data restrictions at work, we can't use Google Drive. One of my former colleagues has managed it before, but even with the source file, I can't work out how he managed it!
Ian
Thanks Matthew. We need to support Chrome and IE/Edge.
Would PDF.js work with those? I'm not hugely proficient at this level of tech/coding in general, so definitely need to find myself a video tutorial it seems.
That's one of the problems I have where I work. We can't use Google Drive/Docs etc as a data company. It's a compliance/data sharing thing. I'd love to upload these docs there and just have the web object point to that, but it's pretty much a non-starter.
Annoying I don't think I can share it as the document itself has sensitive data in it.
When you have a Storyline file with a PDF embedded in it, where do you have the PDF (html and PDF) saved in the whole of your folder structure? Do you have them saved in a folder at the same level as the .story file? Or is it one level down? Does that make a difference? I've attached the two folder paths that i've tested and haven't worked.
You can use a Web Object as a brief case. Here is how it works:
<html>
<body>My PDF Pre-Loader</body>
</html>
Thanks Owen, I really appreciate you taking the time to write that. I think I see what you mean.
A couple of quick clarifications, you can see that a lot of this is new to me...
Answers to follow.
You don't want users to see the actual slide and YES, this is where the web object goes.
YES
Based on what I see, your links are:
story_content/WebObjects/5WsJiZccjVh/PP_Healthcheck.pdf and
story_content/WebObjects/5WsJiZccjVh/Example_one_pager.pdf
NO, as long as you don't add additional files to the folder or change the web object itself, the file will retain this folder title for future publish events.
This post was removed by the author
Thanks Owen, that's really helpful.
That all makes sense, so i'll give it a go tomorrow.
The bit that still confuses me is having the webobject on a 'hidden' slide. Maybe it will make sense once I actually do it.
It isn't so much hidden as it is a slide the user never navigates to. If they did, all they would see is your blank index.html page on a slide. Not very useful for the learner.
The slide's real function, however, is to create a link to the folder where you are keeping all of your stuff. It turns the folder into a sort of suitcase that travels along with the rest of your story content. Does that make better sense?
That does, yeah. I guess I was always imagining a specific html file pointing at a specific PDF. I look forward to giving it a go tomorrow morning.
Someone else asked a similar question a while ago and I created a demo of how this might be done.
https://community.articulate.com/discussions/building-better-courses/interactive-pdf-viewer-within-course
Thanks Nancy. As I understand it, I upload my file, click view, get shown my document, then upload it in my Storyline file with the URL (https://4html.net/ViewerPDF/#/source/PDF_Title_here.pdf) created?
Is that right? Is that likely to be a secure link? The PDFs will contain sensitive data, so that part is key. The whole package will sit on an LMS behind a login, so that element will be fine. I just don't want the PDF 'out there' online.
Hi Owen. I've done the above steps - I can see the PDFs and the html file in that folder, but now I'm not getting the PDF to link. I have my 'hidden' slide/scene 2.1, and a second layer on slide 1.3. I want the PDF to live on that second layer on 1.3.
I've tried the whole folder path from the output folder (....Storyline output\story_content\WebObjects\5tA5bnpp3wp\PP_Healthcheck.pdf), but it's not a valid address.
How do I add that individual PDF link as you point out in Step 7? I presume I just then repeat that same process for the other PDFs on the other layers.
The Security Team just shook their head when I asked about using that website. Oh well, thanks for the tip though.
What version of SL are you using? Are you publishing to html 5?
I'm using SL 360 and publishing to HTML with Flash Fallback.
OK, I tried this and it seems to work for Chrome. I don't have edge to test it there.
<html>
<head>
<title>PDF 1</title>
</head>
<body>
<object data="Sample_PDF_1.pdf" type="application/pdf" width="100%" height="100%">
<p>This browser does not support PDFs. Please download the PDF to view it: <a href="Sample_PDF_1.pdf">Download PDF</a>.</p>
</object>
</body>
</html>
$('iframe').attr('id','MyPDF');
Button 1:
var source='story_content/WebObjects/5uP2wZTlzJo/PDF_1.html';
$('iframe#MyPDF.shown').attr('src', source);
Button 2:
var source='story_content/WebObjects/5uP2wZTlzJo/PDF_2.html';
$('iframe#MyPDF.shown').attr('src', source);
I'm attaching the SL3 .story file as well as a zip of the published example. Unzip the published content to view how it works. Note that if you republish the SL file yourself, you will need to go back in and update a portion of the code to match your new folder destination. In other words, the part shown in bold will change: story_content/WebObjects/5uP2wZTlzJo/PDF_1.html. After you publish, update, and then republish, everything should work.
Actually, the page is doing exactly what I designed it to do when it does not support pdf display... it gives you the option and a link to download it. Perfect test Matthew. :-)
You are right, this is not secure.
Thanks guys.
I still couldn't quite get it to work, so the document ended up being loaded as PDF on our internal server. I have uploaded it with the following script which is similar to your code Owen...
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Code of business conduct document</title>
</head>
<body>
<object data="Code of Business Conduct.pdf" type="application/pdf" width="100%" height="100%">
<p><b>PDF Title is here</b>: This browser does not support PDFs. Please download the PDF to view it:
<a href="https://PDFurlishere.pdf">Download PDF</a>.</p>
</object>
</body>
</html>
When I launch/test the index.html file it opens full screen in my browser. However, when I launch it after i've puplished it, it looks like this...
I even went back and used Owen's initial code but I just had a black 'Initializing' screen.
I've looked the Player, changed the width and height, but still no joy.
Any ideas what might be making this happen?
I would probably need to see the .story file to trouble shoot.
I tried a second version and instead of resizing at all, I just let it fill the screen and published. It looked fine. I went back in and 'gently' resized it, published, and again it worked.
It seems like it didn't like it went I 'quickly' resized it.
This may not be the solution, surely, but it seemed to work for me.
This discussion is closed. You can start a new discussion or contact Articulate Support.