IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Page 1 of 2 1 2 >
Topic Options
#50447 - 12/18/14 01:04 PM Hyperlinks on text boxes in pdf.
Aday1230 Offline
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]
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
Here's a global function I use from time to time.
Code:
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(&current.x*72)+' '+floattostr(&current.y-(&fontheight*2/3))+ ' ' + floattostr((&current.x+stringwidth(&caption))*72) + ' ' +  floattostr(&current.y+(&fontheight/3))+']')
  passthrough('/Action << /Subtype /URI /URI (' + &url + ') >>')
  passthrough('/Border [ 0 0 0] /ANN pdfmark')
  show(&caption)
  define(&newX,measure,&current.x)
  grestore()
  rmoveto(&newX,0)
endfunction()


To call it, create a PressTalk on your page and use something like this:
Code:
@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.]
Aday1230 Offline
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
#50454 - 12/19/14 10:20 AM Re: Hyperlinks on text boxes in pdf. [Re: Aday1230]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
Hi Aday,

Phil's code seems to work for me. However, a size of "2" ended up being very small and it was difficult to click, next to impossible if the zoom was too small. Have you tried simply changing the size to a bigger size? (like 24, for example)

Regards,
Raphaël Lalonde Lefebvre

Top
#50455 - 12/19/14 10:28 AM Re: Hyperlinks on text boxes in pdf. [Re: Raphael Lalonde Lefebvre]
Aday1230 Offline
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]
Aday1230 Offline
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.]
Gary du Plooy Offline
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]
Philippe F. Offline
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]
HawaiiDay Offline
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]
Philippe F. Offline
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
Page 1 of 2 1 2 >