Admin print action
The admin print action component specifies a URL for print operations in admin print action extensions. Use admin print action to define the print target when merchants trigger print actions from the Shopify admin, enabling custom print views optimized for physical or PDF printing.
Learn how to build an admin print action extension.
Anchor to PropertiesProperties
Configure the following properties on the admin print action component.
- Anchor to srcsrcsrcstringstring
The URL of the document to preview and print. Supports HTML, PDF, and image formats. If not provided, the preview will show an empty state and the print button will be disabled.
Anchor to ExamplesExamples
Anchor to Set a print source URLSet a print source URL
Set the print source URL for an admin print action extension. This example shows the component pointing to an external URL for printing.
Preview
html
Anchor to Print a PDF documentPrint a PDF document
Point directly to a PDF file for printing invoices or receipts. This example sets the src to a PDF URL that the browser renders in the print preview.
Preview
html
Anchor to Use a dynamic print URLUse a dynamic print URL
Build the print URL with query parameters to customize the output per order or template. This example passes order ID, template name, and locale as URL parameters.
Preview
html
Anchor to Best practicesBest practices
- Use print-optimized URLs: The URL should point to a page specifically designed for printing with print CSS stylesheets that hide navigation, adjust colors for readability, and set appropriate page dimensions.
- Test across print scenarios: Verify output when printing to PDF, physical printers, and different paper sizes. Test with both color and black-and-white settings.
- Handle dynamic content: If the print URL includes order-specific or time-sensitive data, ensure it's properly encoded in the URL parameters and accessible at print time.
- Validate URL accessibility: Ensure the print URL is accessible to merchants. Check authentication requirements and that the page loads successfully before printing.
Anchor to LimitationsLimitations
- Only HTML, PDFs, and common web image formats (JPEG, PNG, GIF, WebP) are supported for the print source URL.
- If the
srcproperty isn't provided, the preview will show an empty state and the print button will be disabled.