Forum Discussion
Creating downloadable pdf files in Storyline - an update on earlier methods
I am late to the party, but REALLY want to pull this off. I am working on a Roles and Actions course that will culminate in a "Now go do it!" kind of sheet. I would love for them to be able to download it. I worked the JS into what I needed(Story attached). I have the document(attached as well). I think all of it looks good. I am publishing to a LMS from Storyline and telling it to create a Zip file. I have put my document ALL OVER the zip file to try to make sure it found the document. When I preview it or load it into the LMS and go through it, when I click the button nothing happens.
Now, interesting fact, I loaded your notes demo in the LMS and in preview from Storyline and nothing happens with it either. SO, I am think my code my be good, but it is not finding a file.
I have also changed the URL for the document to our SharePoint site and that does nothing too.
Help me Obi-Won Kenobi!
PS: I added triggers to fill out what you can see on the screen and then I got smart with the things your can't but are on the PDF and added it to the variable default. :)
Hi Hunter,
I got my version of this working with the PDF form included in the zip file. But I intend to embed these Storyline "forms" in some Rise courses instead of publishing the standalone Storyline projects, in which case I think the PDF document would need to be hosted externally instead of included in the zip file. Do you know what the URL would look like in the JavaScript if pointing at the file hosted on SharePoint?
Thanks!
- JohnCooper-be3c5 months agoCommunity Member
Hi MichaelT1 I tend to just include the pdf as an attachment at the end of the RISE course:
What you need to do then is open the pdf, note down the url assigned by RISE and then amend the JavaScript to point to this file in the download script.
If you don't like the attachment file sitting in the course, there's another sneaky trick you can use - although Articulate may not be so thrilled about this method - you can add the attachment block in a completely different RISE course. Yes, it really works! For demonstrations I put all my templates as attachment blocks in a course I title "Stuff I need in other courses" then I note the url of the file I want and use the template in any course I like.
(But don't tell anyone about this method as it seems like a cheap way to store files on an on-line server...) 😀
- MichaelT15 months agoCommunity Member
JohnCooper-be3c I tried this and it works, thank you!
Is there a reason to do it this way as opposed to hosting the PDFs in something like SharePoint, though? Ideally I'd point at our usual method for file hosting.
- JohnCooper-be3c5 months agoCommunity Member
Hi MichaelT1
Yes, using SharePoint can definitely work – the main thing to be aware of is file access permissions. The PDF file must be shared publicly or with the expected audience, or else users won’t be able to access it when they try to download it via the Storyline interaction.
You can use a direct link to the file but make sure the SharePoint link points directly to the file, not just a preview page or restricted folder. Also, test the link in an incognito browser window (not logged into your account) to see if access works for others.
I have never tried using a shared link i.e. one generated when you share the document with others I see no reason this wouldn't work but make sure the link you use has the right sharing permissions (e.g., “Anyone with the link” if possible) and test it in a private/incognito browser to ensure it doesn't ask for a login or redirect to a SharePoint preview page. These shared links tend to look long and complex because they encode access permissions. They're not “direct links” in the traditional sense, but they can still work if set up properly.
You may also try adding &download=1 to the end of the link to force the browser to download the file rather than previewing it. But always test before deploying!
You can still use the "hidden RISE attachment block" trick if you want to keep things more self-contained within Articulate’s ecosystem, but SharePoint is a perfectly fine alternative—just needs a bit more attention to permissions.
PLEASE SHARE IF YOU GET THE SHARED LINK WORKING - I would be keen to know!
- Nedim5 months agoCommunity Member
Files hosted on SharePoint are typically not served with the correct MIME types or headers needed for direct binary access. Instead, SharePoint often wraps files in a web-based viewer or forces a download experience through a redirect. Direct binary access means that your JavaScript (or browser) can fetch and process a file as raw binary data, not as an HTML-rendered preview or download link, but as a stream of bytes. For example, when you use:
const formPdfBytes = await fetch(formUrl).then(res => res.arrayBuffer()); ...you’re telling the browser to retrieve the raw PDF file so it can be manipulated (e.g., filled with pdf-lib). However, SharePoint typically prevents this by not allowing the browser to access the file as a pure binary stream. This is why SharePoint-hosted PDFs don’t work with libraries like pdf-lib. It’s not a hosting platform in the traditional sense.I'd upload the PDF file to the Resources section and update the code to:
const formUrl = 'story_content/external_files/notes.pdf';
If this slide is run inside Rise as a Storyline block, it should work without any issues.
Related Content
- 10 months ago
- 4 months ago