title: How to use a variable in Adobe's pdf embed API as URL-value?
body: <p>I use the Adobe PDF Embed API (<a href="https://www.adobe.io/apis/documentcloud/dcsdk/docs.html?view=view" rel="nofollow noreferrer">https://www.adobe.io/apis/documentcloud/dcsdk/docs.html?view=view</a>) to display pdfs within modals on a site of mine.
  As I want the modals to only change in one tiny detail (the file-url of the pdf displayed there) I wanted to use the filename dynamically. So I did that:</p>
  <pre><code>       document.addEventListener(&quot;adobe_dc_view_sdk.ready&quot;, function() {
                                  var adobeDCView = new AdobeDC.View({
                                      clientId: &quot;xyz&quot;,
                                      divId: &quot;adobe-dc-view&quot;
                                  });
                                  adobeDCView.previewFile({
                                      content: {
                                          location: {
                                              var model_filename_chosen = &quot;https://www.URL.com/files/&quot; +
                                                  var model_filename;
                                             // Does get printed correctly
                                              console.log(model_filename_chosen);
                                            //doesn't get parsed at all
                                              url: model_filename_chosen
                                          }
                                      },
                                      metaData: {
                                          fileName: &quot;Something&quot;
                                      }
                                  }, {
  
                                  });
                              });
  </code></pre>
  <p>And that in the header before it</p>
  <pre><code>function openFahrzeugModal(data) {
          x = new bootstrap.Modal(document.getElementById(&quot;modalFahrzeug&quot;));
          x.toggle();
          $('#input_model_hidden').val(data);
          var model_filename = data;
          console.log(data);
      }
  </code></pre>
  <p>And the trigger for those looks then something like that:</p>
  <pre><code>&lt;a onclick=&quot;openFahrzeugModal('myfile1.pdf')&quot;&gt;
     
  </code></pre>
  <p>So any log does get printed correctly but the pdf isn't shown at all, the modal opens up correctly. The variable does get printed in other elements of the modal correctly but within the Adobe embed-thing the result is empty. I do use the same domain for the code and the file and my API-key is valid. As soon as I enter a static URL (the same basically as the one that gets printed on the console) the pdf gets shown correctly.</p>
  <p>Why is that and what would I need to fix?</p>