Skip to main content
Participating Frequently
Sep 27, 2023 8:13 AM UTC
Question

PDF Embed API: Prevent Print and Download

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. 🙂

 

 

    20 replies

    Participant
    Mar 19, 2025 8:31 AM UTC

    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,
    }
    );
    Translate
    Participant
    Oct 16, 2023 9:40 PM UTC

    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.

    Translate
    Raymond Camden
    Community Manager
    Community Manager
    Oct 17, 2023 12:27 PM UTC

    Sorry no.

    Translate
    Participating Frequently
    Oct 17, 2023 12:45 PM UTC

    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

     

    Translate
    Marlo:ASIAuthor
    Participating Frequently
    Oct 5, 2023 7:10 AM UTC

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

     

    Translate
    Participating Frequently
    Oct 5, 2023 9:09 PM UTC

    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/

    Translate
    Marlo:ASIAuthor
    Participating Frequently
    Oct 5, 2023 11:57 PM UTC

    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.

    Translate
    Participating Frequently
    Oct 4, 2023 6:19 PM UTC

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

    Translate
    Raymond Camden
    Community Manager
    Community Manager
    Sep 27, 2023 7:15 PM UTC

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

    Translate
    Marlo:ASIAuthor
    Participating Frequently
    Sep 28, 2023 11:55 PM UTC

    Thank you!

    Translate
    Marlo:ASIAuthor
    Participating Frequently
    Sep 27, 2023 8:14 AM UTC

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

     

    Translate