Skip to main content
Participating Frequently
September 27, 2023
Question

PDF Embed API: Prevent Print and Download

  • September 27, 2023
  • 6 replies
  • 7203 views

Thank you for viewing this post.
We have disabled the download and print buttons to prevent the users.

 

{
  showDownloadPDF: false,
  showPrintPDF: false,
}

 

The problem is when the users `Ctrl+P` or `Cmd+P`,
the following prompt will appear. This gives the user a direct access to download the document.

 



Before this appear, around a month or so, the "Print" keyboard shortcut calls for the browser print. On which we could somehow prevent the content to be shown.

 

Any clue could help. 🙂

 

 

    6 replies

    Participant
    March 19, 2025

    looks like @Pablo37385995lrkv found a workaround on this issue https://community.adobe.com/t5/acrobat-services-api-discussions/disabled-printing-but-ctrl-p-still-prints/td-p/12019385 
    I also empty the iframe source in that callback: 

    adobeDCView.registerCallback(
    AdobeDC.View.Enum.CallbackType.EVENT_LISTENER,
    function (event) {
    if(event.type === "DOCUMENT_PRINT"){
    var iframe = document.getElementById("adobe-dc-view").getElementsByTagName("iframe")[0];
    iframe.src = "";
    location.reload();
    }
    },
    {
    enablePDFAnalytics: true,
    }
    );
    Participant
    October 16, 2023

    Any updates on this issue? I am experiencing the same problem on Firefox and hitting Cmd+P on Chorme brings up the print preview regardless of settings with the PDF showing and the option to save as PDF.

    Raymond Camden
    Community Manager
    Community Manager
    October 17, 2023

    Sorry no.

    Participating Frequently
    October 17, 2023

    He resuelto el tema hasta ahora protegiendo el archivo con "PDF Services API"

    de esta manera al generar el PDF le quito el permiso de imprimir "Protect PDF"

    https://developer.adobe.com/document-services/docs/overview/pdf-services-api/howtos/protect-pdf/

    y al abrir el PDF desde Adobe Embed muestra el siguiente resultado

     

    de la misma manera adobe deja algunos ejemplos de como hacerlo para este caso con JAVA

    https://github.com/adobe/pdfservices-java-sdk-samples

     

    Marlo:ASIAuthor
    Participating Frequently
    October 5, 2023

    Our current workaround is to make the document encrypted and disable printing permission.

     

    Participating Frequently
    October 5, 2023

    Hi Marlo, please could you elaborate more on what you did, I have documented myself and I understand that a password can be added to the PDF with PDF Services API

    https://developer.adobe.com/document-services/docs/overview/pdf-services-api/howtos/protect-pdf/

    Marlo:ASIAuthor
    Participating Frequently
    October 5, 2023

    You could use any PDF library for modifying the file permission. We use a PHP library for implementing this.
    If you need more details, a personal message might be more appropriate.

    Participating Frequently
    October 4, 2023

    Quedo al pendiente tambien del tema para resolve este inconveniente, nosotros lo detectamos en Chrome y Edge (Ctrl + p)

    Raymond Camden
    Community Manager
    Community Manager
    September 27, 2023

    I was able to confirm this on Firefox and I reported it internally. 

    Marlo:ASIAuthor
    Participating Frequently
    September 28, 2023

    Thank you!

    Marlo:ASIAuthor
    Participating Frequently
    September 27, 2023

    Also, we tried accessing the iframe document, to override "keydown" listener, but the CSP policy prevents us.