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

"Focus on PDF rendering" Not Working (+ throwing server error)

New Here ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

Hello everyone!  I'm trying to REMOVE focus from my pdf viewer on render. 

I thought it would be a simple line of code "focusOnRendering: false"... but that has not seemed to work.  The code below re-renders the pdf when an object that contains a pdf <name> and <URL> is clicked.  I would appreciate the help! 🙏🏼

 

<script type="text/javascript">

function renderPdf(fileName, url) {
var adobeDCView = new AdobeDC.View({ clientId: "<id>", divId: "adobe-dc-view" });
adobeDCView.previewFile({
content: { location: { url }},
metaData: { fileName }
}, {embedMode: "FULL_WINDOW",
defaultViewMode: "FIT_WIDTH",
focusOnRendering: false,
enableSearchAPIs: false,
showZoomControl: false,
enableLinearization: true,
enableSearchAPIs: false,
showBookmarks: false,
});

}

$('.piecenamecontainer').on('click', function () {renderPdf($(this).find('.piecename').text(), $(this).find('.pdf').text()) });
document.addEventListener("adobe_dc_view_sdk.ready", function () { renderPdf("{<name>}", "{<PDF_URL>}") });
 
</script>

Views

572

Translate

Translate

Report

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
Adobe Employee ,
Sep 06, 2022 Sep 06, 2022

Copy link to clipboard

Copied

So... a few things. You can calling renderPDF when our library launches, _and_ you are calling it on click, is that what you meant to do? 

 

Secondly, are you 100% sure removing focusOnRendering makes the code work fine?

 

Can you share a public URL where I could see this?

Votes

Translate

Translate

Report

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
New Here ,
Sep 08, 2022 Sep 08, 2022

Copy link to clipboard

Copied

LATEST

Hello Raymond, sorry for the late reply.  Yes, I am trying to render the pdf on click.  

The code to render the pdf is working just fine.  The argument to 'remove focus' is all that's not working. 

I'm quite new to development, but I'm trying to make a digital sheet music repertoire.

Here ya go: https://www.clairmusic.com/spaces/rousseau-classical

 

I'm trying to do this to add keyboard shortcuts.  Yet, it renders the pdf, keyboard shortcuts are just active for the pdf rather than the site. 

Votes

Translate

Translate

Report

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
Resources