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

Adobe PDF Embed API - ASP.Net

New Here ,
Sep 09, 2021 Sep 09, 2021

Hello,

After generating credentials and pasting the sample code, I get the following error from my ASP.Net Web Forms page:

 

Line: 29
Error: Object doesn't support property or method 'addEventListener'

 

Is there some trick to adding an event listener in ASP.Net?

 

ASPX page code:

 

<%@ Page Title="" Language="VB" MasterPageFile="~/master/MasterPage.master" AutoEventWireup="false" CodeFile="DisplayPDF.aspx.vb" Inherits="public_DisplayPDF" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <div id="adobe-dc-view" style="width: 800px;"></div>

    <script src="https://documentcloud.adobe.com/view-sdk/main.js"></script>
    <script type="text/javascript">
	    document.addEventListener("adobe_dc_view_sdk.ready", function(){ 
		    var adobeDCView = new AdobeDC.View({clientId: "7ddfa288fa684d35a2bacb64c7eedef5", divId: "adobe-dc-view"});
		    adobeDCView.previewFile({
			    content:{location: {url: "https://documentcloud.adobe.com/view-sdk-demo/PDFs/Bodea Brochure.pdf"}},
			    metaData:{fileName: "Bodea Brochure.pdf"}
		    }, {embedMode: "IN_LINE", showDownloadPDF: false, showPrintPDF: false});
	    });
    </script>    

</asp:Content>

 

Kind regards,

 

Jay

 

TOPICS
JavaScript
895
Translate
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
Community Expert ,
Sep 09, 2021 Sep 09, 2021
LATEST

Hi,

 

I am not an expert as that is not an Adobe problem as such. Which browser are you targetting, as it should exist, the only thing I knew was that IE used attachEvent, rather than addEventListener.

 

Just a stab in the dark

Translate
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