Open created pdf in new teb instead of downloading it.
Permalink Browser Info Environment
Is it possible to change that? I would rather have that pdf in browser, and have possibility to download, than instant download - can it be changed? Thanks for any help.
Type: | Discussion |
---|---|
Status: | In Progress |
Hello I am not actively working on this anymore, but if you're so inclined I can tell you what to change if you're comfortable modifying files. If you open /packages/trans_marine_save_area_to_pdf/blocks/save_area_to_pdf/controller.php. Line 78 has:
$mpdf->Output(t($c->getCollectionHandle().".pdf"), "D");
you should be able to remove the , "D" for:
$mpdf->Output(t($c->getCollectionHandle().".pdf"));
to instead open in a tab. Good luck. -J
$mpdf->Output(t($c->getCollectionHandle().".pdf"), "D");
you should be able to remove the , "D" for:
$mpdf->Output(t($c->getCollectionHandle().".pdf"));
to instead open in a tab. Good luck. -J
Thanks for fast response.
Unfortunatelly, after that change it stopped working. When I click the button it refresh the page (so form is sent), but only difference is, that it's not downloading nothig, as well as nothing is opening in new tab.
I would appriciate if you would have some more advices. :)
Unfortunatelly, after that change it stopped working. When I click the button it refresh the page (so form is sent), but only difference is, that it's not downloading nothig, as well as nothing is opening in new tab.
I would appriciate if you would have some more advices. :)
You can also try replacing the "D" with "I"
$mpdf->Output(t($c->getCollectionHandle().".pdf"), "I");
$mpdf->Output(t($c->getCollectionHandle().".pdf"), "I");
Brilliant, we are much closer - it works, but opens in the same tab - is there option to add some kind of target="_blank" - or maybe change that "I" some other letter?
You can submit your form with target="_blank".
Eg:
<form id="reportFrm" name="reportFrm" target="_blank" action="{{ url($viewInfo['url'].'/report') }}" class="form-horizontal" method="post">
so when click on pdf button or priview it will open in new tab.
Eg:
<form id="reportFrm" name="reportFrm" target="_blank" action="{{ url($viewInfo['url'].'/report') }}" class="form-horizontal" method="post">
so when click on pdf button or priview it will open in new tab.
$mpdf->Output(t($c->getCollectionHandle().".pdf"), "D");
you should be able to remove the , "D" for:
$mpdf->Output(t($c->getCollectionHandle().".pdf"));
to instead open in a tab. Good luck. -J