Download & Extend

Please open the pdf in a new navigator window

Project:Pdfview
Version:5.x-1.x-dev
Component:User interface
Category:feature request
Priority:minor
Assigned:Unassigned
Status:reviewed & tested by the community

Issue Summary

for the average user, is more friendly open the pdf in a new navigator window. I include the code that does so.

added target=_blank,

******* code ****************************
/**
* Theme a Pdfview link
* @ingroup themeable
*/
function theme_pdfview_link($node) {
if ((user_access('access content as PDF') || user_access('administer nodes'))
&& variable_get('pdfview_'.$node->type, 1) == 1) {
$attributes = array("title" => t('Display a PDF version of this
page.'),"target" => t('_blank'));
$links = l(t('download PDF'), "node/$node->nid/pdf", $attributes);
}
return $links;
}
******* code end l****************************

Comments

#1

Status:active» closed (works as designed)

It's up to the user to set up his browser to do that

#2

Version:4.7.x-1.x-dev» 5.x-1.x-dev
Status:closed (works as designed)» reviewed & tested by the community

What do you mean it's up to the user to set his browser to do it? It's fairly customary when moving away from an HTML page to something else to open it in another window or tab, just as the code above suggests. This is a good addition and works.

#3

Priority:normal» minor

While yes, you can use a setting to open windows in a new tab / window in the preferences in most browsers, what is being talked about here is instead of navigating away from the page where the .pdf document is referenced, it will automagically open a new tab in which the .pdf document is displayed, thereby keeping the original page up for the user to see.

#4

Where do I have to put this code ?
Thanks

nobody click here