Currently PDF files are saving in var directory.
Here is controller's execute function
public function execute() { $orderId = $this->getRequest()->getParam('id'); if ($orderId) { $order = $this->orderRepository->get($orderId); if ($order) { $pdf = $this->orderPdfFactory->create()->getPdf([$order]); $date = $this->date->date('Y-m-d_H-i-s'); return $this->fileFactory->create( 'order' . $date . '.pdf', $pdf->render(), DirectoryList::VAR_DIR, 'application/pdf' ); } } return $this->resultRedirectFactory->create()->setPath('sales/*/view'); }
DirectoryList::VAR_DIR,
Above code responsible for that. Now my question is that I want to save pdf files under var/pdf directory. How can I do this ?