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

PDF Embed API: Download via Ctrl+P

Community Beginner ,
Mar 06, 2024 Mar 06, 2024

Help, we cannot seem to "print" to download PDF files now.

On Firefox browser, we solved this by adding:

"blob:"

on multple CSP Directives depending on what the error says.

"object-src",
"frame-src"


But on Chrome, we got this error:

RuntimeError: Aborted(CompileError: WebAssembly.instantiate(): Refused to compile or instantiate WebAssembly module because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' use.typekit.net assets.adobedtm.com www.adobe.com/marketingtech/ prod.adobeccstatic.com/utilnav/ widget.uservoice.com by2.uservoice.com/t2/ assets.adobe.com api.demandbase.com/api/v2/ip.json commerce.adobe.com"). Build with -sASSERTIONS for more info.
at abort (index.js:8:5302)
at index.js:8:1432623

 

Our setup:
Enable the "print" and "download" for comparison. Then try the "print" or Ctrl+P key shortcut.

var previewFilePromise = adobeDCView.previewFile(
    // document config
    {
        content: {
            location: {
                url: url
            }
        },
        metaData: {
            fileName: file_name,
            hasReadOnlyAccess: true,
        },
    },
    // Viewer config
    {
        showAnnotationTools: false,
        showDownloadPDF: true,
        showDisabledSaveButton: false,
        showPrintPDF: true
    }
);

 Screenshot 2024-03-06 at 6.19.21 PM.jpg


For now, we are searching if we could programmatically enable download if the user enters the "owner" password.

Thanks for the help in advance. 🙂

TOPICS
Authentication , Bug , PDF Embed API
779
Translate
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
Community Beginner ,
Mar 06, 2024 Mar 06, 2024

On Chrome, the demo is working.

Translate
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 ,
Mar 06, 2024 Mar 06, 2024

So to be clear, our demo works, yours did not, right? Can you share an example online where we can see and verify?

Translate
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
Community Beginner ,
Mar 06, 2024 Mar 06, 2024
LATEST

Yes @Raymond Camden, the demo works. Maybe I will try to make a minimal setup then build up from there.
Sorry but we could not share an online example.

Translate
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