Linking to a PDF

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
QuadraQ
Sr. Propeller Head
Posts: 119
Joined: Fri Feb 20, 2009 5:59 pm

Linking to a PDF

Post by QuadraQ »

Hello all,

Forgive me if I'm asking a common question. I tried searching for "link to PDF" and it complained that the words were too common!

Anyway, I'm moving over our documentation from Adobe InDesign to Flare. One of the nicest things that InDesign allows you to do, is to use PDF documents very much like images. For example here is a report that was generated in our program and saved to a PDF file, then placed in our documentation like an image:
Example.png
I can't emphasize enough how useful this is for print output targets. For now Flare doesn't support this, and for web output these examples should simply be links to the pdf files. However I have no idea how to do that. How can I add a link to a document (pdf specifically) within Flare?
You do not have the required permissions to view the files attached to this post.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Linking to a PDF

Post by NorthEast »

I think that is done by using the embed HTML tag, which sticks the PDF in the page.

You can't put in an embed tag directly using Flare, but it lets you have them in your topics. You'd have to edit the topic in text mode and enter the tag by hand.
A google for "embed PDF" gives plenty of information, e.g. http://blogs.adobe.com/pdfdevjunkie/200 ... to_di.html. Note that in XHTML you need to close your tags, so you'd have <embed src="my.pdf" ... />
In fact, if you look at the HTML code generated by InDesign, you might also be able to copy/get ideas from that.

If you just want to add a link to the PDF though, that's easy enough - just drag the PDF from content explorer into your topic to make a link, or insert a normal topic link (it shows topics initially, so change the filter to show 'all files').

Also, note that you can't have MOTW (mark of the web) enabled if you have links to local PDF files, it'll stop them working.
Sharpras
Sr. Propeller Head
Posts: 138
Joined: Fri May 05, 2006 10:17 am
Location: Redmond, WA

Re: Linking to a PDF

Post by Sharpras »

Dave's suggestions didn't work for my WebHelp project.
With Flare 6.0, I tried both methods, linking and embedding. The link does nothing. The embed code displays in the web page with a faint, square border on it containing a small icon in the upper left corner. I'm opening the WebHelp on my local PC.

Do I have MOTW enabled? I looked at the source of the web page with the PDF link on it, and also the first page of the Help file. Neither had "MOTW" in it. Where else should I look? Could something else be wrong?

I noticed that can "Save Target as" when I right-click the PDF link, and save the PDF to a local drive.

Thanks,
Roger
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Linking to a PDF

Post by LTinker68 »

Sharpras wrote:Do I have MOTW enabled?
Check the Advanced tab of the WebHelp target to see if you enabled the "Insert Mark of the Web" option. If you did, then you have MOTW enabled.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Sharpras
Sr. Propeller Head
Posts: 138
Joined: Fri May 05, 2006 10:17 am
Location: Redmond, WA

Re: Linking to a PDF

Post by Sharpras »

Sovled. MOTW had been enabled.

Thanks.
bobmoon
Sr. Propeller Head
Posts: 259
Joined: Thu Mar 27, 2008 10:22 am
Location: Atlanta

Re: Linking to a PDF

Post by bobmoon »

QuadraQ wrote:I tried searching for "link to PDF" and it complained that the words were too common!
The search function on the forum is frustrating in this regard. It's a problem with the bulletin board software that MadCap uses.

You can get full-text searches of the forum by going to Google and entering "site:http://forums.madcapsoftware.com <search terms>". Or, if you're a Firefox user, you can also use Dave Lee's nifty MadCap search plug-in. See the discussion here: viewtopic.php?p=45836#p45836.

Bob
Kag_sailor
Jr. Propeller Head
Posts: 1
Joined: Thu Jan 14, 2010 11:22 am

Re: Linking to a PDF

Post by Kag_sailor »

I was equally frustrated by the search issue of having 'pdf' ignored as search criteria! Uuugh.

I want to have down-loadable pdf files available for a few areas in my web help. I was hoping to just link to a .pdf file located at a public url ... but reading some of this I'm thinking it won't be that easy? Someone made the recommendation to "just copy the .pdf file from the content explorer" ... how do I get the pdf file INTO the content explorer. Is that necessary if I just want to link to an external file that someone would then have the option to print or download off the web. :shock: Any help would be GREATLY appreciated.

Thanks a bunch!
Sharpras
Sr. Propeller Head
Posts: 138
Joined: Fri May 05, 2006 10:17 am
Location: Redmond, WA

Re: Linking to a PDF

Post by Sharpras »

Kag_sailor,

I have not linked to an external PDF. However, if you copy the PDF to the Content folder of the Help project, then you can add a link to it with a message such as
right-click this link Download PDF and select Save Target As. Save the PDF to a local drive.
This works in WebHelp even with MOTW enabled.

Roger
berniexmeyer
Propeller Head
Posts: 35
Joined: Thu Dec 23, 2010 3:09 pm
Location: Oregon, USA

Re: Linking to a PDF

Post by berniexmeyer »

Hi, All. Two questions about this:
1.
I read Dave Lee's post about embedding PDFs in Help topics with interest. I followed the link to the Adobe blog article on this, which was even more intriguing. But I am not clear on what the differences are (pros/cons for diff purposes) between using a simple hyperlink to a PDF file and using the embed tag.

2.
When I created a hyperlnk to a PDF, it worked great from the Help topic when I built the Help target. However, the link also shows up in my PDF target, and looks like link text, but when I click on it, I get an error msg that says the file cannot be found at: and gives the path, which is exactly where it really is. The only possibly odd thing is that the drive spec is prefixed by 3 slashes ( \\\C:pathname ). Maybe this is standard notation for XML, I just don't know. But in any case, I'd like to make the link work in the PDF target, too, or else learn how to exclude it from that target.

Can anyone speak to these questions?
Much thanks!
- Bernie
Sharpras
Sr. Propeller Head
Posts: 138
Joined: Fri May 05, 2006 10:17 am
Location: Redmond, WA

Re: Linking to a PDF

Post by Sharpras »

Bernie,
All I know about issue #1 is that when embedded, the PDF will add to the size of the CHM (or whatever your output is). Also, when it is not embedded, you rely on other people (or systems) to ensure that the PDF is indeed in the correct directory.


#2. I think I understand what you are saying: the PDF you refer to is an output of the same help file, and the link in the PDF points to itself. If this is the case, you should consider using Conditional text and make the link to the PDF conditional on the type of output so that it doesn't show up when you outut to PDF (and when you output to the other targets, it does show up).

Roger
berniexmeyer
Propeller Head
Posts: 35
Joined: Thu Dec 23, 2010 3:09 pm
Location: Oregon, USA

Re: Linking to a PDF

Post by berniexmeyer »

Thanks, Roger. The answer about embedding vs hyperllinking is good to know.
===
On the second question, I was probably not clear. The PDF being referenced is NOT the same PDF as is being created as the Target. It is a PDF of a document that is outside the Flare project and not related to it in any way. The link to it works fine from the WebHelp target, but not from the PDF target,

Pre-existing document outside Flare project:
[C:\\MyDocs\PreExistingDoc.PDF]

Flare Project: Build WebHelp Target ==>
MyPrintManual.PDF
hyperink==>>[C:\\MyDocs\PreExistingDoc.PDF] (Works great)
====================
Flare Project: Build Print WebHelp Target ==>
MyWebHelp\Topic_n.htm
hyperink==>[C:\\MyDocs\PreExistingDoc.PDF] (Err: Cannot Find File at: C:\\MyDocs\PreExistingDoc.PDF)
Last edited by berniexmeyer on Tue Jan 25, 2011 5:33 pm, edited 1 time in total.
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: Linking to a PDF

Post by i-tietz »

If you want to link to the PDF it doesn't have to be part of the project:
shortcut_to_pdf.png
As you see I even used a relative path: ../ means the PDF is one folder up the structure.
You do not have the required permissions to view the files attached to this post.
Inge____________________________
"I need input! - Have you got input?"
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Linking to a PDF

Post by NorthEast »

i-tietz wrote:If you want to link to the PDF it doesn't have to be part of the project:
As you see I even used a relative path: ../ means the PDF is one folder up the structure.
Shortcut controls can only be used in HTML Help targets; so it's no good for either PDF or WebHelp.
berniexmeyer wrote:On the second question, I was probably not clear. The PDF being referenced is NOT the same PDF as is being created as the Target. It is a PDF of a document that is outside the Flare project and not related to it in any way. The link to it works fine from the WebHelp target, but not from the PDF target,
When you hover over the link in your PDF file, does it actually point to the correct location of the PDF file?
And what actually happens when you click it?

I think Flare might handle a link to a local drive differently to a file on a website; it might create a relative path to the file.
berniexmeyer
Propeller Head
Posts: 35
Joined: Thu Dec 23, 2010 3:09 pm
Location: Oregon, USA

Re: Linking to a PDF

Post by berniexmeyer »

When you hover over the link in your PDF file, does it actually point to the correct location of the PDF file?
And what actually happens when you click it?

I think Flare might handle a link to a local drive differently to a file on a website; it might create a relative path to the file.
Thanks Dave.
Both the project and the PDF I am linking to are on my C drive. I recreated a hyperlink to the PDF in a topic, just to verify the behavior:

> When I saved and previewed the topic, the link worked in both "print" and "non-print" layout modes.

> When I built the WebHelp, the linked worked.

> When I built the PDF target and rolled over the link, it showed the "hand" cursor with a little "W" in it, and showed the path in a tooltip-like popup, which was:

"file:///C|/NWEA%20Documents/Projects/FlareSingleSourceTests/Content/BernieTestWordImport2/Test_PDF_Import.pdf

This is the correct location, but I noticed that the path includes the characters %20 where there is a folder name with a space in it (NWEA Documents). I wonder if this might be the problem. I seem to recall running into problems in Flare at another compnay in certain cases when a folder name contained a space. I am hesitant to rename that folder, because I don't know if all links and references in the project will then be broken.

> When I clicked the link in the PDF, I got a security warning that said, "The document is trying to connect to <correct pathname as shown above>. If you trust this site, click 'Allow'," which I did. This produced an error message that said, "Cannot find <pathname>."

Any ideas?
- Bernie
berniexmeyer
Propeller Head
Posts: 35
Joined: Thu Dec 23, 2010 3:09 pm
Location: Oregon, USA

Re: Linking to a PDF

Post by berniexmeyer »

I just learned that hyperlinks to a PDF cannot work in the PDF target because there is no folder structure in the output containing resources (such as the referenced PDF) to be accessed. Further, even if the link worked, others who view the PDF target on their computers will not have the referenced PDF file at the same file path where it was referenced originally on my computer.

I've been advised to try hosting the second PDF on the internet and then, in my Flare project create a hyperlink of type "Website" and point to the URL of the hosted PDF. I haven't tried this yet.
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: Linking to a PDF

Post by i-tietz »

berniexmeyer wrote:Further, even if the link worked, others who view the PDF target on their computers will not have the referenced PDF file at the same file path where it was referenced originally on my computer.
And you cannot generate the same structure in your project?
Inge____________________________
"I need input! - Have you got input?"
berniexmeyer
Propeller Head
Posts: 35
Joined: Thu Dec 23, 2010 3:09 pm
Location: Oregon, USA

Re: Linking to a PDF

Post by berniexmeyer »

Sorry, not quite sure what you mean.
i-tietz
Propellus Maximus
Posts: 1219
Joined: Wed Oct 24, 2007 4:13 am
Location: Fürth, Germany

Re: Linking to a PDF

Post by i-tietz »

If the structure in the project looks like this:
a.htm
b.htm
c.htm
the structure in the end user folder should also be:
a.pdf
b.pdf
c.pdf
and not
a.pdf
folder X/b.pdf
folder Y/c.pdf

That way links in the PDFs cannot work. You need identical file structures.
Inge____________________________
"I need input! - Have you got input?"
Post Reply