Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
874 views
in Technique[技术] by (71.8m points)

Is there any way to open TCPDF output in a new tab/window without using HTML tag("target=_blank")?

I have a question, I'm using TCPDF to generate report in pdf format using php, and I'm struggling to open the TCPDF output in new tab but unable to achieve it. Can anyone help me.

Thanks in advance. I've tried with the php code for TCPDF output.

<pre>require_once('library/tcpdf.php');
$obj_pdf = new TCPDF('L', PDF_UNIT, 'A4', true, 'UTF-8', false);
$obj_pdf->SetCreator(PDF_CREATOR);
$obj_pdf->SetTitle("Vehicle Report");     
$obj_pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));  
$obj_pdf->SetDefaultMonospacedFont('helvetica');  
$obj_pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$obj_pdf->setPrintHeader(false);  
$obj_pdf->setPrintFooter(false);  
$obj_pdf->SetAutoPageBreak(TRUE, 10);
$obj_pdf->AddPage();

<pre>$obj_pdf->setFont('freesans', '',9);
$obj_pdf->writeHTML($content , true, false, true, false, '');
ob_end_clean();
$obj_pdf->output('pdfReport.pdf', 'I', '_blank');
window.open('pdfReport.pdf', '_blank');
question from:https://stackoverflow.com/questions/65902659/is-there-any-way-to-open-tcpdf-output-in-a-new-tab-window-without-using-html-tag

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...