I am using Salesforce Lightning I want to open a PDF in new tab.
HYPERLINK('/apex/myapexpage?param='+some_param,'View', '_blank')
The page is still opening in the same Visualforce Page, not in new tab. I know it can be done through javascript as:
<apex:page controller="ViewPDF" showHeader="false" sidebar="false">
<!--object data="data:application/pdf;base64,{!match1}" width="100%" height="500px"></object-->
<script>
let pdfWindow = window.open("")
pdfWindow.document.write('<object data="data:application/pdf;base64,{!match1}" width="100%" height="100%"></object>');
</script>
</apex:page>
It opens the PDF in new tab, but make the existing page blank.
Is there a way by which the PDF opens in a new tab without affecting the existing page?