Copy link to clipboard
Copied
Hi,
I am trying to use PDF Embed viewer in my .NET web application and running in my local machine. Its giving some error while giving the pdf url to the viewer.
Error : Error: Cannot get DCAPI rendition if DCAPI is disabled
Code Sample
URL : https://localhost:7088/
JS Method
document.addEventListener("adobe_dc_view_sdk.ready", function () {
var adobeDCView = new AdobeDC.View({
clientId: "APIKey" // Replace with your actual Client ID
});
var pdfUrl = document.getElementById("pdfUrl").value;
if (pdfUrl) {
adobeDCView.previewFile({
content: { location: { url: pdfUrl } },
metaData: { fileName: pdfUrl.split("/").pop() }
}, { embedMode: "IN_LINE" });
}
});
function previewFile(url, fileName) {
var adobeDCView = new AdobeDC.View({ clientId: "APIKey" });
adobeDCView.previewFile({
content: { location: { url: url } },
metaData: { fileName: fileName }
}, { embedMode: "IN_LINE" });
}
Error Screen
Copy link to clipboard
Copied
Do you have a client ID for "localhost"?
Copy link to clipboard
Copied
I'm having the same issue. I'm just trying to get the demo to work in my Blazor app .NET 8, but I keep getting the DCAPI error/promise rejection and after checking I do have a client ID for localhost still the same issue.
Copy link to clipboard
Copied
You won't be able to run Embed API on client-side Blazor apps. It only works in browsers.