Skip to main content
Participant
August 26, 2020
Frage

PDF Embed API in VueJS

  • August 26, 2020
  • 3 Antworten
  • 7633 Ansichten

Hi everyone,

we're planning to integrate the pdf embed API in our VueJS App. Does anyone have experience in how to Setup or Use it in Vue? 
Unfortunately I didnt find any related articles for that.

Thanks for your help

    Dieses Thema wurde für Antworten geschlossen.

    3 Antworten

    Raymond Camden
    Community Manager
    Community Manager
    December 20, 2021

    Hi! I've done many examples of Embed + Vue. Here's my first example: https://www.raymondcamden.com/2021/02/17/using-the-pdf-embed-api-with-vuejs

     

    If I can help more, let me know.

    Participant
    December 27, 2021

    Hi there! Is there any way to use this api in Vue 3?

    Raymond Camden
    Community Manager
    Community Manager
    January 4, 2022

    Yes you can, I attached a sample.

     

    https://gist.github.com/AlexandruMiricioiu/0ac17faf92e5dd72eabdae21bdbbe4a2

    Don't forget to include the script in your index.html

     

    https://documentcloud.adobe.com/view-sdk/main.js

     


    Hi, a quick note about your code. In mounted, you add an event listener for adobe_dc_view_sdk.ready, but you should not that sometimes - especially in a Vue app, the event will have already fired. I typically use code like this:

    if(window.AdobeDC) displayPDF();
    else {
    	document.addEventListener("adobe_dc_view_sdk.ready", () => displayPDF());
    }
    

     

    Known Participant
    September 5, 2020

    I am using the PDF embed API with Vue.js. Feel free to send me a message so I can share my implementation with you.

    Participant
    December 20, 2021

    Hello,

    Can you share your implementation please?

    I can't figure out a way to work as a Vue component.

     

    Thank you.

    Known Participant
    December 20, 2021

    Certainly! Please send your emailadress in a DM and then I can send it to you.

    Joel Geraci
    Community Expert
    Community Expert
    August 26, 2020

    I don't have any direct experience with VueJS (yet) but it looks like it would be fairly simple to create a Vue component that implements Embed API.