#50447 - 12/18/14 01:04 PM
Hyperlinks on text boxes in pdf.
|
OL Newbie
Registered: 12/18/14
Posts: 4
|
I have searched the forums and came up with some great info on using PlanetPress talk for hyperlinks, however I still can't seem to get them to work the way I intend.
I have no problem when I type out the URL in full, for example 'http://www.objectiflune.com'. But when I try to add that same URL to text I created for it to be clickable, it does not work.
Is it possible to add a clickable link to simple text instead of having to type out the entire URL?
|
Top
|
|
|
|
#50449 - 12/18/14 01:26 PM
Re: Hyperlinks on text boxes in pdf.
[Re: Aday1230]
|
OL Expert
Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
|
Here's a global function I use from time to time.
function @PDFHyperLink(&url: string, &caption: string, &fontheight: measure)
gsave()
if(lowercase(left(&url,7))<>'http://')
&url := 'http://'+&url
endif()
setstyleext(&internal.defaultfont,&fontheight,1,[100,100,0,0],-1)
passthrough('[/Subtype /Link')
passthrough('/Rect [ '+floattostr(¤t.x*72)+' '+floattostr(¤t.y-(&fontheight*2/3))+ ' ' + floattostr((¤t.x+stringwidth(&caption))*72) + ' ' + floattostr(¤t.y+(&fontheight/3))+']')
passthrough('/Action << /Subtype /URI /URI (' + &url + ') >>')
passthrough('/Border [ 0 0 0] /ANN pdfmark')
show(&caption)
define(&newX,measure,¤t.x)
grestore()
rmoveto(&newX,0)
endfunction()
To call it, create a PressTalk on your page and use something like this: @PDFHyperLink('www.objectiflune.com','click here',2)
_________________________
Technical Product Manager I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen
|
Top
|
|
|
|
#50453 - 12/19/14 10:15 AM
Re: Hyperlinks on text boxes in pdf.
[Re: Philippe F.]
|
OL Newbie
Registered: 12/18/14
Posts: 4
|
Thank you for your quick response. Unfortunately, it is still not working when I create the pdf. The text 'click here' is not clickable therefore it will not take you to the objectiflune webpage as displayed in the code.
|
Top
|
|
|
|
#50455 - 12/19/14 10:28 AM
Re: Hyperlinks on text boxes in pdf.
[Re: Raphael Lalonde Lefebvre]
|
OL Newbie
Registered: 12/18/14
Posts: 4
|
Hello Raphael, Yes I made the font size larger and still nothing. I made a global function using the code Phillipe suggested and then I used a PressTalk box to call the code with the second string he posted. The second string I put directly into 'PlanetPress Talk code' Any idea what could be going wrong?
|
Top
|
|
|
|
#50456 - 12/19/14 11:09 AM
Re: Hyperlinks on text boxes in pdf.
[Re: Aday1230]
|
OL Newbie
Registered: 12/18/14
Posts: 4
|
I do apologize, this does work after all. I failed to create the pdf in workflow. Thank you both so much for your help!
|
Top
|
|
|
|
#53796 - 08/08/16 04:44 AM
Re: Hyperlinks on text boxes in pdf.
[Re: Philippe F.]
|
OL Toddler
Registered: 05/16/14
Posts: 39
Loc: Gauteng
|
Hi Philippe,
Thank you for the code below. I have been using it for some time and it works well.
My question is not so much a PlanetPress question, but the follow through. How can I set up my link so that when used in a PDF the third party can successfully click on the link and have it open. Currently the link opens a popup stating security concerns.
Any suggestions?
I look forward to your reply.
_________________________
Gary du Plooy Ducks quack, Eagles soar – How will you approach today?
|
Top
|
|
|
|
#53800 - 08/08/16 09:20 AM
Re: Hyperlinks on text boxes in pdf.
[Re: Aday1230]
|
OL Expert
Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
|
This is likely due to Acrobat Reader's settings. See this link for more information.
_________________________
Technical Product Manager I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen
|
Top
|
|
|
|
#54124 - 10/27/16 06:45 PM
Re: Hyperlinks on text boxes in pdf.
[Re: Aday1230]
|
OL Newbie
Registered: 10/13/16
Posts: 4
|
Hi Philippe,
Thank you for that code. Seems I am running into an issue with memory when I run it thru the PDF digital action. The input file is in XML and the file is about 200MB. Is there someone I can do to fix this? Below is the message from the Watch logs.
DEBUG: Parsed document: RTM.ptk DEBUG: Generating an Optimized PostScript Stream job. DEBUG: Initializing state... DEBUG: Initializing document RTM.ptk... DEBUG: Loading data file C:\ProgramData\Objectif Lune\PlanetPress Suite 7\PlanetPress Watch\Spool\3.tmp\job00ZW1LL0D4LTFD9247D83CB.dat... WARN : PTK0212: Unable to open datafile in current emulation:Out of memory WARN : PTK0212: Unable to open datafile in current emulation:Out of memory ERROR: W3001 : Error while executing plugin: Out of memory ERROR: Digital Action: W1603 : Plugin failed - 13:21:26
|
Top
|
|
|
|
#54127 - 10/28/16 07:52 AM
Re: Hyperlinks on text boxes in pdf.
[Re: Aday1230]
|
OL Expert
Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
|
You'll have to split the file in order to process it. A 200mb XML file, once expanded in memory, can easily take up several GB's or RAM, which Workflow isn't able to provide since it is a 32bit application.
_________________________
Technical Product Manager I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen
|
Top
|
|
|
|
|
|