Skip to content

Downloading the PDF file

Let’s use React PDF to generate a PDF file for a product with dynamic content based on the product data provided by the Shopify Storefront API.

See commit "Product PDF"
  • Install the React PDF package.
  • Update the Storefront API GraphQL query to include the product data needed for the PDF generation.
  • Use Read PDF to generate the PDF file.
  • Update the Gadget route response to return the PDF file.
See commit "PDF download"
  • Use the received PDF data to open it in a new tab as an inline PDF file.