TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
Subject:Re: Use target="_blank" in embedded PDF links? From:"Sweet, Gregory P (HEALTH)" <gregory -dot- sweet -at- health -dot- ny -dot- gov> To:"salt -dot- morton -at- gmail -dot- com" <salt -dot- morton -at- gmail -dot- com>, "techwr-l -at- lists -dot- techwr-l -dot- com" <techwr-l -at- lists -dot- techwr-l -dot- com> Date:Thu, 24 Aug 2017 13:55:30 +0000
You found this in somewhere that said it would work in Acrobat? This code is looking for <a> elements and adding target=â_blankâ to each one. I am not sure that will work when Acrobat doesnât allow you to specify the target attribute when just entering a web link to begin with.
I do think you need javascript and think youâd need window.open() attached to each link to force acrobat to use new browser windows/tabs. If only because how pdfs behave in the browser is largely up to the user and browser manufacturer. Chrome/Safari/Firefox all handle PDF natively without an acrobat plugin, so settings will be by browser. Not sure what IE or EDGE is up to these days, and I am too lazy to check.
Cheers!
Greg
On 8/24/17, 8:56 AM, "techwr-l-bounces+gregory -dot- sweet=health -dot- ny -dot- gov -at- lists -dot- techwr-l -dot- com on behalf of Chris Morton" <techwr-l-bounces+gregory -dot- sweet=health -dot- ny -dot- gov -at- lists -dot- techwr-l -dot- com on behalf of salt -dot- morton -at- gmail -dot- com> wrote:
ATTENTION: This email came from an external source. Do not open attachments or click on links from unknown senders or unexpected emails.
Acrobat Pro includes a JavaScript editor, and this code is supposed to open
every link in a new window:
function externalLinks()
{ for(var c = document.getElementsByTagName("a"), a = 0;a
< c.length;a++) { var b = c[a]; b.getAttribute("href")
&& b.hostname !== location.hostname && (b.target = "_blank") } } ;
externalLinks();
When I use the JavaScipt Editor, it displays this by default:
//-------------------------------------------------------------
//-----------------Do not edit the XML tags--------------------
//-------------------------------------------------------------
So I'm guessing this is how it goes together:
//-------------------------------------------------------------
//-----------------Do not edit the XML tags--------------------
//-------------------------------------------------------------
<script>
function externalLinks()
{ for(var c = document.getElementsByTagName("a"), a = 0;a
< c.length;a++) { var b = c[a]; b.getAttribute("href")
&& b.hostname !== location.hostname && (b.target = "_blank") } } ;
externalLinks();
</script>
But when I click *[OK]*, the JS Editor complains about the <c.length;a++
syntax.
On Thu, Aug 24, 2017 at 8:16 AM, Chris Morton <salt -dot- morton -at- gmail -dot- com> wrote:
> Apparently the AutoBookmark plug-in lets me do this, but it's $189.... WAY
> too expensive for the single page I want to perform this single operation
> on.
>
> Another person has a different tool, but it requires every viewer to have
> Java installed; that's too much of a restriction.
>
> Chris Morton
> (click logo â for details)
> <http://www.the-efa.org/dir/memberinfo.php?mid=15271>
> â Substantive Editing â Technical Writing â Proofreading
> â B2B/B2C â Marketing Expertise â Mentoring
>
>
>
> On Thu, Aug 24, 2017 at 7:59 AM, Chris Morton <salt -dot- morton -at- gmail -dot- com>
> wrote:
>
>> I'm using Acrobat Pro DC.
>>
>> I'm required to use its Edit mode, then create a sort of bounding box
>> around the item I want to link. From there, Acrobat offers few options.
>>
>> I have no trouble inserting the URLs to create each link, but simply
>> tacking on a *target="_blank"* does not yield the desired result when I
>> open the resulting PDF in a browser.
>>
>> Chris Morton
>> (click logo â for details)
>> <http://www.the-efa.org/dir/memberinfo.php?mid=15271>
>> â Substantive Editing â Technical Writing â Proofreading
>> â B2B/B2C â Marketing Expertise â Mentoring
>>
>>
>>
>> On Wed, Aug 23, 2017 at 3:48 PM, Chris Morton <salt -dot- morton -at- gmail -dot- com>
>> wrote:
>>
>>> If so, how can I do this?
>>>
>>> Thanks
>>>
>>> Chris Morton (click logo â)
>>>
>>> <http://t.sidekickopen68.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJN7t5XYgdnqQxW7fsH3H4XrddKW1pNgV-56dMhqf2Q-c6C02?t=http%3A%2F%2Fwww.the-efa.org%2Fdir%2Fmemberinfo.php%3Fmid%3D15271&si=6020636811198464&pi=74057096-fb97-48e7-c59d-70bfe6671665>
>>> â Substantive Editing â Technical Writing â Proofreading
>>> â B2B/B2C â Marketing Expertise â Mentoring
>>>
>>>
>>>
>>
>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Visit TechWhirl for the latest on content technology, content strategy and content development | http://techwhirl.com
Looking for articles on Technical Communications? Head over to our online magazine at http://techwhirl.com
Looking for the archived Techwr-l email discussions? Search our public email archives @ http://techwr-l.com/archives
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Visit TechWhirl for the latest on content technology, content strategy and content development | http://techwhirl.com