Skip to main content
Adobe Employee
June 17, 2022
Question

PDF Embed API pageControl issue

  • June 17, 2022
  • 1 reply
  • 315 views

I am using the PDF Embed API to add a PDF viewer to my popup dialog box.

For some reason, the pageControl doesn't scroll the page when I click up/down button. So, I tried hiding the pageControl using the following configuration, but it doesn't seem to work

 const viewerConfig = {
        showPageControls: false,
        embedMode: "IN_LINE"
    };

 below is my code snippet

var mainScript  = document.createElement("script");
mainScript.setAttribute('src', 'https://documentcloud.adobe.com/view-sdk/main.js' );

var pdfviewerScript =  document.createElement("script");
pdfviewerScript.setAttribute('src','pdfviewer.js');

dialog.content.appendChild(mainScript);
dialog.content.appendChild(pdfviewerScript);
dialog.show();

 pdfviewer.js

(function (document, $){
    const viewerConfig = {
        showPageControls: false,
        embedMode: "IN_LINE"
    };

    document.addEventListener("adobe_dc_view_sdk.ready", function()
    {
        var filePath = document.getElementById("pdf-timeline-script").getAttribute("filepath");
        var adobeDCView = new AdobeDC.View({clientId: <ClientID>, divId: "pdf-timeline-preview"});
        adobeDCView.previewFile(
            {
                content:   {location: {url: filePath}},
                metaData: {fileName: "fileName"}
            }, viewerConfig);
    });
})(document, $)

 How can I resolve the pageControl scroll issue or hiding it? Thanks!

This topic has been closed for replies.

1 reply

Raymond Camden
Community Manager
Community Manager
June 20, 2022

Do you have this online where we can see?