I have following code:
<?php
namespace UV\Bestellung\Controller\Adminhtml\Index;
use Magento\Framework\App\Action\Action;
use Magento\Framework\Controller\ResultFactory;
class Index extends Action
{
public function generateBestellschein() {
$pdf = new Zend("Bestellschein.pdf");
return $pdf;
}
public function execute()
{
return generateBestellschein();
}
}
I am creating a PDF via
generateBestellschein();
and
execute();
is executed when custom button is clicked. I want it to start a download of the PDF.
How do I do that?