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
MysteriousCleon
View Replies:
jstrong replied on at Permalink Reply
jstrong
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
jstrong replied on at Permalink Reply
jstrong
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
MysteriousCleon replied on at Permalink Reply
MysteriousCleon
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. :)
jstrong replied on at Permalink Reply
jstrong
You can also try replacing the "D" with "I"

$mpdf->Output(t($c->getCollectionHandle().".pdf"), "I");
MysteriousCleon replied on at Permalink Reply
MysteriousCleon
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?
pllvpnl64 replied on at Permalink Reply
pllvpnl64
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.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.