pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maruan Sahyoun <sahy...@fileaffairs.de>
Subject Re: How to add annotation that opens url in new tab/window ?
Date Sat, 23 Apr 2016 17:55:15 GMT
Hi,

> Am 23.04.2016 um 19:47 schrieb Tilman Hausherr <THausherr@t-online.de>:
> 
> Hi,
> 
> If you download this PDF
> https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf
> open it, then go to the second page, and click on the link, what happens?
> 
> (I suspect this is rather a problem of the browser or an Adobe Reader setting)
> 
> Tilman
> 
> Am 23.04.2016 um 13:27 schrieb Jana Sefcikova:
>> Hi, I am using pdfbox to create links inside pdf as follows:
>> 
>> PDAnnotationLink txtLink = new PDAnnotationLink();
>> 
>> // code for setting position
>> 
>> PDActionURI action = new PDActionURI();
>> 
>> action.setURI("http://www.google.com");
>> 
>> txtLink.setAction(action);


a regular link annotation doesn't have the capability. What you can do is adding a JavaScript
with the following content

app.launchURL("http://yoururl", true);

replacing <yoururl> with the actual one.

Be aware that this JavaScript is application specific so might not work in Readers other than
Adobe Reader / Acrobat.

BR
Maruan


>> 
>> But when I open pdf in browser and click on the annotated text, it opens
>> url in the current tab in the browser.
>> 
>> 
>> Can I open links in new tab using pdfbox ? If yes, could you provide some
>> example ?
>> 
>> Thank you very much
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message