function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shalini RShalini R 

Output link will open into new tab on VF pdf template

Hi,

I created one visualforce page as pdf template. I added object field values and attachment links on this template. When i click on this attachment link, the attachment need to show on new tab. But now it will show on same page. Please share me if you know the solution.

Attachment Linking Code 

<apex:outputLink  value="{!URLFOR($Action.Attachment.Download,samplelink)}" >Click to show taachment</a>

Thanks,
Shalini R
Suraj TripathiSuraj Tripathi
Hi Shalini,
 
<apex:outputLink  target="_blank" value="{!URLFOR($Action.Attachment.Download,samplelink)}">Click to show taachment</a>



Kindly mark this as solved if it's resolved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.

Regards
Suraj
Shalini RShalini R
Hi Suraj,

Thanks for your response.
No, it will open on the same page not in new tab.

Regards
Shalini R
Suraj TripathiSuraj Tripathi
Hi Shalini,

You don't have to use <a> tag for the link. Then it will work fine.
Shalini RShalini R
Hi Suraj,

I have to write mistaken in post, but i used outputlink in Visualforce page its working fine. Pdf file not support this. This is a problem.