• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

A way to preview a local PDF?

Community Beginner ,
May 29, 2020 May 29, 2020

Copy link to clipboard

Copied

I'm running into an issue where I cannot preview a local pdf.

I have tried:

 <script type="text/javascript">
    document.addEventListener("adobe_dc_view_sdk.ready", function()
    {
        var adobeDCView = new AdobeDC.View({clientId: "43b7fe695ddb49899bd5d90f222f5b7c", divId: "adobe-dc-view"});
        adobeDCView.previewFile(
       {
          content:   {location: {url: "file:///C:/my/sandbox/local_file.pdf"}},
          metaData: {fileName: "local_file.pdf"}
       }, {embedMode: "IN_LINE", showDownloadPDF: true, showPrintPDF: true});
    });
 </script>

 

But I always just get a "File preview error":

r002_2-1590777558906.png

 

In the Adobe View SDK repo, I did see the "Work with Local File" example.  But this is not what I'm looking for.  In the example, it uses a File Uploader.  For my purposes, I want to just hardcode a local file location for my PDF into my JS code (preferably relative to my index.html file).  That way I can easily work on my local machine.

 

Can you please advise?  Thank you!

 

PS.  Note that my index.html is located in "file:///C:/my/sandbox/" in the same dir as local_file.pdf.

Views

164

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources