Copy link to clipboard
Copied
Hello. I just wanted to share a fun little web app I made with the adobe pdf API. It's a sheet music repertoire that loads new pdf files with the click of a new song. It was a bit of a struggle to figure out the code, so I hope it might help someone else!
Here's the site: https://www.clairmusic.com/apollo
Bellow is the code!
<!--Adobe PDF reader -->
<script src="https://documentcloud.adobe.com/view-sdk/viewer.js"></script>
<script type="text/javascript">
function renderPdf(fileName, url) {
console.log(fileName, url);
var adobeDCView = new AdobeDC.View({ clientId: "<ID>", divId: "adobe-dc-view" });
adobeDCView.previewFile({
content: { location: { url }},
metaData: { fileName }
}, {
embedMode:"FULL_WINDOW",
focusOnRendering: false,
defaultViewMode: "FIT_WIDTH",
enableSearchAPIs: false,
showZoomControl: false,
});
}
$('.piecenamecontainer').on('click', function () {renderPdf($(this).find('.piecename').text(), $(this).find('.pdf').text()) });
document.addEventListener("adobe_dc_view_sdk.ready", function () { renderPdf("<initial name>", "<Inital pdf URL>") });
</script>
Copy link to clipboard
Copied
Wow, this is pretty freaking cool!
Copy link to clipboard
Copied
Thankssss!!!
Copy link to clipboard
Copied
Nice work. I've shared your link internally.