Skip to content

Photoshop error “Could not replace [filename.pdf] because of a program error” when dragging PDF page into an open document #3679

@sajidanwar2020

Description

@sajidanwar2020

Steps to Reproduce:

https://www.loom.com/share/434487b1bf5a4552929acbd0804f95b1

Open an image or new document in Photoshop.

Drag a multi-page PDF file into the canvas area.

When prompted to select a page, choose Page 1 and click OK.

Expected Behavior:
The selected PDF page should replace the current document or be placed as a new layer.

My code:

   $options = [
                'isPhpEnabled' => true,  // Enable PHP execution within the PDF (if required)
                'dpi' => 300,             // Adjust DPI to match client's image scaling
                //'defaultFont' => 'Helvetica', // Optional: specify a default font
                'isRemoteEnabled' => true,
            ];

            $pdf = Pdf::loadView('admin/products/product', compact('product', ))
                ->setOptions($options); 
        }
        $file_name =  'File_name';

        return $pdf->stream(trim($file_name, '_-') . '.pdf', ['Attachment' => false]);

Actual Behavior:
Photoshop displays an error message:

“Could not replace [filename.pdf] because of a program error.”

Description:

Environment:

Photoshop Version: 22.0.0 (2020 release)

OS: Windows 10 64-bit (Build 10.0.26100.6725)

GPU: Microsoft Basic Render Driver (no dedicated GPU detected)

PDFs generated via TCPDF or using any other tool working fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions