cancel
Showing results for 
Search instead for 
Did you mean: 

Linking to various sections within a PDF document

Former Member
0 Kudos

Hi all - I haven't found anything within the forums in regards to the following question:

I've created PDF's via Livecycle, and I want to be able to link to different locations within the PDF in question. I'm basically going to have a table of contents at the top of the PDF, and when users click on the various topics, they will be routed to the topic they click on.....how do I do this in a PDF? Is there an example somewhere, or example code? I couldn't find an example within the LiveCycle help....part of my problem is knowing what to look for.....i.e. what object to use, and what the javascript should be?

Thanks in advance for your help!

Steve

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi all.....just wanted to see if anyone has had success in using a Table of Contents in a PDF file . More specifically, I'm trying to allow a user to click on a heading/link within the Table of Contents, and then be taken to the page of the specific topic they want to read. I need to do this in LiveCycle, but unfortunately, it's my understanding that in order to be able to be directed to a text field somewhere within the PDF doc, you can only do that if the field you are navigating to is an editable field. I don't have, nor need, any editable fields (other than the Table of Contents) within my PDF (it's just text). I tried hiding a checkbox within the text field that I was navigating to, but it doesn't always work, and sometimes I get odd characters showing up....here is the code I used to try to navigate:

xfa.host.setFocus("xfa.form.TopmostSubform.Page6.Table.Row.Cell.Ownership");

'Ownership' is the text heading I am trying to navigate to, but it won't work unless, as stated before, the field I'm navigtating to is an editable field. Is there a way around this?

Thanks!

Former Member
0 Kudos

Hi Steven,

Is 'Ownership' a text or a text field set to read-only? I did a quick test and it looks like you cannot set the focus to a text but you can set it to a text field which is set to read-only. This might be a workaround for you (use a text field or add a read-only text field that does not display anything and set the focus to that field).

Regarding you comment on odd characters. I only heard this if a) the "s were missing in the parameter for setFocus or b) the parameter itself was not correct, often you have to add "[x]" with x as number of the actual instance of the field you mean.

Regards,

Juergen

Former Member
0 Kudos

Hi Juergen - the field I'm trying to navigate to is just text. Anyway, I just did what you said....making a text field read-only, and that works great! I actually had taken a checkbox and shrunk it down and hid it behind the text, thereby allowing me to navigate to the heading. But, as I stated before, making the text-field read-only is a better solution.

Thanks for your suggestion!

Regards,

Steve

Answers (1)

Answers (1)

harman_shahi
Contributor
0 Kudos

Hi Steven,

The following is the code to goto a specific page inside the form:

// Place the following in the 'onClick' event of the button and test. this will take you to page 3 of your form
xfa.host.currentPage = 2;

(Not sure how to link to a specific field though ! )

hope this helps.

harman

Former Member
0 Kudos

Harman - awesome, that definitely helps. I have 'Back to Top of Page' links which I've set up as.......

xfa.host.currentPage = 0;

....to take me back to the top of the first page. That works perfectly.

Next, I'll see if I can figure out how to go to specific locations within the PDF. I'll let you know what I find out!

Steve