Skip to main content
Participant
October 22, 2022
Answered

Adobe pdf embed api lightbox not working in mobile browsers

  • October 22, 2022
  • 1 reply
  • 858 views

Code

<script src="https://documentservices.adobe.com/view-sdk/viewer.js"></script>
<script type="text/javascript">
  document.addEventListener("adobe_dc_view_sdk.ready", function () {
    document.getElementById("CV").addEventListener("click", function () {
      var adobeDCView = new AdobeDC.View({
        clientId: "203e1bacaee04c58b0e7c0ffeddfb6e7",
      });
      adobeDCView.previewFile(
        {
          content: {
            location: {
              url: "https://dhanurjan.ga/wp-content/uploads/2022/10/Dhanurjan-CV.pdf",
            },
          },
          metaData: { fileName: "Dhanurjan-CV.pdf" },
        },
        { embedMode: "LIGHT_BOX" }
      );
    });
  });
</script>

I have a button with ID = CV.

When I click it pdf opens. But it not working in mobile browsers.

Website URL: dhanurjan.ga

    This topic has been closed for replies.
    Correct answer Dhanurjan

    Turned off minify JavaScript option in the wp-rocket cache plugin. After that everything works fine.

    1 reply

    DhanurjanAuthor
    Participant
    October 22, 2022

    Getting this error only in mobile view.

     

     

     

    DhanurjanAuthorCorrect answer
    Participant
    October 23, 2022

    Turned off minify JavaScript option in the wp-rocket cache plugin. After that everything works fine.