aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Links in PDFs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Links in PDFs" Watch "Links in PDFs" New topic
Author

Links in PDFs

John Gordon Martin
Greenhorn

Joined: Jan 14, 2012
Posts: 15


1. I’ve been advised that the way a PDF on my website is displayed in a browser has something to do with Java Script (still an enigma to me) so I need to ask a lot of dumb questions about it.
2. If this is not the right place, would someone please direct me to the appropriate forum?

John Martin
http://geriatricgourmet.com/
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61767
    
  67

We have a forum for HTML and JavaScript to which I have moved this post. If you are reading this, you have found it.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61767
    
  67

[Note: a reply before this one has been split to another forum]

OK, to start off, Java and JavaScript have nothing at all to do with each other, despite the poor choice in naming them similarly. Like in this old joke:



Your opening comment seemed to indicate that the subject was to be JavaScript, but apparently it's to be Java. So I split out your Java setup question to the Beginning Java forum. You will find your post there.

As to the difference between Java and JavaScript, that's easy: everything. It's like thinking about the difference between a saw and a pair of pliers. Both tools, but they nothing at all to do with each other.

John Gordon Martin
Greenhorn

Joined: Jan 14, 2012
Posts: 15
Now that I understand that Java and JavaScript are not the same thing, here is my problem and what I am trying to do and I hope I’m in the right forum this time.

It is difficult and complicated for me to explain (dummy that I am) and it may be even more difficult to understand my explanation……………but here goes:

I put PDFs on my website: http://geriatricgourmet.com/

When you click on them, they open in a new tab next to the tab that is open to my website. Example: http://geriatricgourmet.com/files/Texas_Barbequed_Brisket.pdf

The PDFs have links in them. Example: Smoke (http://www.smoking-meat.com/), first word, third paragraph.

When you click on the links in the PDFs, the PDF is replaced (in its tab) buy the site that the link refers to in the same tab.

I would like for the PDF to remain open and the link in the PDF to open the site it refers to in a new tab, or page, so that folks who are viewing the PDF can refer to (see) the PDF and the newly opened page (site) at the same time.

I asked some PDF folks abut this e.g. Adobe, Bluebeam, Nitro and others, and they told me that this has something to do with JavaScript, and now I’m trying to learn what.



[Thumbnail for PDF example 2.jpg]

[Thumbnail for Texas & PDF tabs.jpg]

[Thumbnail for Texas & Smoking Meat tabs 2.jpg]

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

Aha. So your question is "How do I make a link in a PDF open in a new window?", is it?

(When you ask a question on a forum it's usually better to ask your original question, instead of a derived question which may well be based on faulty assumptions or bad guesses. So that's your original question.)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61767
    
  67

Paul Clapham wrote:Aha. So your question is "How do I make a link in a PDF open in a new window?", is it?


I don't think so. I think it is "How do I get a link within a PDF to open a new browser window/tab?". And that is a much different question that for a link embedded in a web page.

I know little to nothing about PDFs, and especially how they work internally. Is JavaScript involved? I don't know. Is a PDF a JavaScript platform? Certainly, Java has no part in this. (So if this is why you were investigating Java, that's a complete red herring.)
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

I know that PDF is a Javascript platform because that caused PDF to become a malware carrier a few years ago.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

After I googled for "pdf hyperlink" I found this: How to Make a Hyperlink in a PDF File. It seems to be simple, straightforward, and it also seems to answer the question we think was originally intended. Without mucking about with Javascript either.
John Gordon Martin
Greenhorn

Joined: Jan 14, 2012
Posts: 15
I don't think so. I think it is "How do I get a link within a PDF to open a new browser window/tab?". And that is a much different question that for a link embedded in a web page.

Yes, that is my question.

Well, I was hoping to avoid this. I have several community colleges near me (took a course in HTML a few years ago).
Sometimes I can get my problems solved in forums; sometime not. I guess I’d best just go sign up for a course in JavaScript. I’m just bouncing around from forum to forum here and it’s getting too hard to keep up with. After I do some more research, I may try again in a week or so but meanwhile, thanks to all for your responses.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

Doesn't that link I just posted explain exactly how to set up a link in a PDF? Or was it unhelpful for some reason?
John Gordon Martin
Greenhorn

Joined: Jan 14, 2012
Posts: 15
Thank you Paul,

I have put hundreds of links (maybe a thousand by now………..been doing it about 4-5 years) in PDFs.

That’s not the problem. I’ll try again.

The problem is to get the link (from a PDF on my site) to open in a new tab, so that the PDF and the page to which the link refers, can be seen simultaneously. This would be so that the person viewing the PDF can continue to see it, and also refer to the new page at the same time. This is helpful when you are trying to cook something from a recipe on a computer………..without having to download, save, print etc. I do it (cook while looking at a computer) often.

I know it’s confusing. I get confused trying to say it but I know what I’m after……………probably a wild goose and it’s hard to catch.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

Okay. Well, as you can see your focus on Javascript has brought you to a forum full of people who know little or nothing about PDF. So, this isn't the place to ask (sorry about that). To me it looks like you should be asking on a forum about PDF or Adobe Acrobat.
John Gordon Martin
Greenhorn

Joined: Jan 14, 2012
Posts: 15
Yes, you are right. It’s just that that’s where I started and they PDF folks told me that it had something to do with JavaScript so I came here. I’ll go back to the PDF forums and chase the goose there some more. She flies fast and makes lots of sharp turns.
John Gordon Martin
Greenhorn

Joined: Jan 14, 2012
Posts: 15
PS, at least I learned the difference between Java and JavaScript. That was a confusion that I may not have been the first person to have.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Links in PDFs