Bobby
Bobby

Reputation: 375

How to have image target new window or _blank using FPDF?

In my app the PDF gets opened in the web page and in the below example, when the users clicks on Logo.png it's getting redirected to FPDF site in the same page, but i want to open the link in the new window, instead of opening in the same window, so the users has the PDF opened.

$pdf->Image('logo.png',10,10,30,0,'','http://www.fpdf.org');

Upvotes: 3

Views: 1275

Answers (2)

Nikul Chauhan
Nikul Chauhan

Reputation: 21

Yes I have tried some workarounds for this but its seem to not possible currently. But I have achieved this using ViewerJS.

Just display pdf using viewerjs(pdf js). Just put this line $('a').attr('target', '_blank'); after div.setAttribute('data-loaded', true); inside viewer.js file.

And you will find target blank. Hope this helps!

Upvotes: 2

Scott
Scott

Reputation: 3764

Sorry, I am pretty sure that this is not possible currently.

Upvotes: 0

Related Questions