0
Adobe PDF Embed API - ASP.Net
New Here
,
/t5/acrobat-discussions/adobe-pdf-embed-api-asp-net/td-p/12372325
Sep 09, 2021
Sep 09, 2021
Copy link to clipboard
Copied
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/acrobat-discussions/adobe-pdf-embed-api-asp-net/m-p/12372667#M327934
Sep 09, 2021
Sep 09, 2021
Copy link to clipboard
Copied
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

