Copy link to clipboard
Copied
I am not having success getting my PDF to display using the pdfembedapi sample. I changed <YOUR CLIENT ID> to my is and the url to my link and I just get a grey box with no text.
When I simple connect to the url from a browser it displays fine.
<!--Get the samples from https://www.adobe.com/go/pdfembedapi_samples-->
<!DOCTYPE html>
<html>
<head>
<title>Adobe Acrobat Services PDF Embed API Sample</title>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1"/>
</head>
<body style="margin: 0px">
<div id="adobe-dc-view"></div>
<script src="https://acrobatservices.adobe.com/view-sdk/viewer.js"></script>
<script type="text/javascript">
document.addEventListener("adobe_dc_view_sdk.ready", function()
{
var adobeDCView = new AdobeDC.View({clientId: "3bc1b2f94f054af88da8cade3c6d2214", divId: "adobe-dc-view"});
adobeDCView.previewFile(
{
content: {location: {url: "https://grcloud.com/apps/kilwins_store/mcards/menu_card_0995.pdf"}},
metaData: {fileName: "Menu Card.pdf"}
});
});
</script>
</body>
</html>
Copy link to clipboard
Copied
If you open your browser dev tools, you will see there is a CORS error with the PDF. You have to change your CORS setting on the PDF, on _that_ web server (grcloud) to allow for remote sites to access the content.