Using magento 2, front and admin, I need to access controller in print button on sale order page to print invoice which generate pdf in front view controller. Plz.

1 Answer 1


If you need to do that, I am sure using redirect to your front end controller should be worked.

public function getPrintUrl()
    $baseUrl = $this->_urlInterface->getBaseUrl();
    return $baseUrl.'/order/printpdf/invoice_id/'.$this->getInvoice()->getId();
  • Do you have any code? Commented Jan 15, 2019 at 7:27
  • 1
    You save my day. Commented Jan 15, 2019 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.