I am currently manually creating a pdf file of my products but, I would like to display my page as a pdf file for download when I click a button, as they are the same content.
I would like to control how it displays, can I create page-item.pdf.twig template so that if a user visits www.example.com/page-item.pdf it will display a pdf.
if this is not supported by Grav I was thinking of using TCPDF
how can I add this to Grav?
As per the documentation
Grav is a flexible platform however, and can actually serve up any content type you could wish for (
xml,rss,json,If you were to request a route with a
.xmlextension, for example:/blog.xml, instead of using the regularblog.html.twigtemplate to render it, Grav looks for a template calledblog.xml.twig. You would need to ensure that template outputs the appropriate XML structure.