Forum Discussion

BrandiPeel's avatar
BrandiPeel
Community Member
15 days ago

"Save as PDF" HTML not working in Rise360 and Chrome

I am using Rise360 Beta HTML feature and I am trying to add a Download as a PDF button. The issue I am running into is that Chrome and Edge are blocking the download. I even tried the option to open in a new browser so the user can manually download instead and it is still blocked. When I test the code in W3 it works perfectly. Any solutions or workarounds?

The original code is attached.

I am new to HTML so I recognize those limitations. I have been asking ChatGPT to help out and none of the solutions are working. 

2 Replies

  • Chris-Hurst's avatar
    Chris-Hurst
    Community Member

    I had to insert a Storyline block to get around this. In my case it's a Word download, the download button in Storyline fires this JavaScript.

    // === STORYLINE: SAVE THIS BLOCK'S 5 ENTRIES TO LOCALSTORAGE ===
    var player = GetPlayer();
    
    // Give this Storyline block a unique part id:
    var partId = "Design"; // change in each embedded Storyline: part-1, part-2, ...
    
    // Fill in the 5 prompts and the corresponding Storyline variable names for THIS block
    // (Use your exact on-screen copy as labels, and exact variable names)
    var fields = [
      { label: "Write clear learning objectives", value: player.GetVar("Entry_Analyse") || player.GetVar("D1TextEntry1") || "" },
      { label: "Choose format (course, workshop, job aid, etc.)",                                        value: player.GetVar("Entry_Design")  || player.GetVar("D1TextEntry2") || "" },
      { label: "Map content flow (topics in order)",                           value: player.GetVar("Entry_Develop") || player.GetVar("D1TextEntry3") || "" },
      { label: "Select active learning methods",                       value: player.GetVar("Entry_Implement")|| player.GetVar("D1TextEntry4")|| "" },
      { label: "List supporting media",                                       value: player.GetVar("Entry_Evaluate")|| player.GetVar("D1TextEntry5") || "" }
    ];
    
    // Optional: include a short title for this block (e.g., "Analyse", "Design", etc.)
    var blockTitle = "Design";
    
    // Save payload
    var payload = {
      id: partId,
      title: blockTitle,
      savedAt: new Date().toISOString(),
      fields: fields
    };
    
    // Use a shared collection key in localStorage
    var KEY = "RiseCombinedNotes__parts";
    var parts = [];
    try { parts = JSON.parse(localStorage.getItem(KEY) || "[]"); } catch(e){ parts = []; }
    
    // Replace if this part already exists; otherwise append
    var idx = parts.findIndex(p => p && p.id === partId);
    if (idx >= 0) { parts[idx] = payload; } else { parts.push(payload); }
    
    // Persist
    localStorage.setItem(KEY, JSON.stringify(parts));
    
    // (Optional) quick feedback back into Storyline via a variable:
    try { player.SetVar("NotesSavedOK", true); } catch(e) {}
    
    

     

  • Hi BrandiPeel​!

    Glad to see Chris has been helping you!

    I noticed that you've also connected with my teammates Luiza and Wilbert, through a support case. Smart move! It looks like Luiza just replied to your e-mail sharing insight and suggestions.

    We can continue the conversation there to keep all information in one spot.