A user is attempting to preview and print PDF files directly within Shopify’s admin print extension dialog, similar to how HTML endpoints work.
Initial Confirmation:
The admin UI extensions team confirmed that PDF endpoints should be supported.
Implementation Issue:
Despite using what appears to be correct code structure (base64-encoded PDF with proper headers: Content-Type: application/pdf and Content-disposition: inline), the PDF preview is not displaying correctly. The user shared code showing they’re returning a Buffer from base64 data with appropriate headers.
Working Solution Provided:
A team member shared a functional Remix example that:
Creates a simple PDF using raw PDF syntax
Converts to base64 then back to Buffer
Returns via CORS-enabled Response with identical headers
Successfully displays in the preview dialog
Browser Compatibility Issue:
A separate user reported that Chrome blocks the base64 PDF preview, while Firefox and Edge display it correctly. This suggests a browser-specific limitation rather than a code implementation problem.
Status: The discussion remains open with a potential Chrome-specific blocking issue identified.
Summarized with AI on October 24.
AI used: claude-sonnet-4-5-20250929.
We are trying to invoke printing from the new admin print extension. We have an endpoint that is returning a PDF content and we would like to print and preview it directly in the admin dialog (same as HTML endpoint). Is it possible, or we have to preview/print only HTML endpoints?
@Liam Could you please provide more details or examples on how the endpoint should be structured from the admin UI extensions team? Currently, I need help getting it to work for me.
We came up with a simple, somewhat contrived, example so we could make our Remix app do basically the same thing that you have in your example, with the same headers and the same Base64 encoding.