• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

RH10 - Hyperlink an external pdf to chm file

New Here ,
Oct 03, 2013 Oct 03, 2013

Copy link to clipboard

Copied

Hi,

I am Prateek, India. I am a technical writer & am working on RoboHelp. I am facing few issues with hyperlinks.

Let me straight away take to a scenario:

I have generated a chm file, name: "dynamic.chm" ( folder: D\Dynamic)

In this chm there are 3 links. viz: one.pdf, two.pdf, three.pdf ( folders random & each pdf is 50kb)

When I generated a chm file without giving hyperlinks, the size was 50kb.

I gave hyperlinks in a standard(robohelp -> create a project -> topic1 -> some text -> create hyperlink -> link to dropdown -> file -> select a pdf from a location) manner and generated chm output, the size was about 200kb.

My requirement: While having the chm size at 50kb, I need all the 3 hyperlinks to work fine. How can this be done?

Is there anyway where we can dynamically hyperlink the pdf files to the content?

As like in a word document, while giving hyperlink we provide "same folder", is there any option in RH? - I mentioned this because, we will be having a whole set of 100 documents in a single folder, and we will place the help file in the same folder. So, whenever a hyperlink is clicked, it must trigger the related .pdf file.

Thanks a lot in advance.

Regards,

Prateek Thungathurthy

Views

3.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 03, 2013 Oct 03, 2013

Copy link to clipboard

Copied

Hi Prateek.

By linking to a PDF as you have, the file is added as a baggage file inside your project. That is why the CHM file increases. If you want to maintain the CHM size at 50kb you'll have to host the PDFs somewhere and hyperlink by adding a URL to them. That way the files are NOT part of the project.

Out of interest, why is 200kb such a big issue?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 03, 2013 Oct 03, 2013

Copy link to clipboard

Copied

Hi,

Thanks for your reply.

Got your point. But let me be more specific with the actual scenario.

We need to deliver a customer a set of files. These files are clubbed in a folder called "user". The user folder contains "300+ pdfs and 2 chms". Each chm has about 100 or so links to pdfs. We will add more links in future though.

These chms(when generated) should contain only the links, but not embedded, so that whenever I click on a link, it should pull the pdf from these 300+ pdfs. Can be be done? If yes, please let me know the process too.

*I am not sure how we give the "user" folder to the customer. It may be through a hard disk/server access/something else.

For now, we have the 'user' folder in SVN repository.

Second part, 200kb is really not a concerning factor, but that was just an example. our chms(embedded) have crossed 1.2gb already. We want to cut down the weight.

Regards.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 04, 2013 Oct 04, 2013

Copy link to clipboard

Copied

In that case you have two choices:

  1. Package up the 300+ PDFs in the install together with the CHMs. The link path to the PDFs would just be <filename>.pdf. However this has the drawback that the link would be broken if the PDF or CHM were ever moved from their original location.

  2. Add a hyperlink to each PDF file. This adds each PDF as a baggage file and increases the CHM file size. It does have the advantage that you only need to install the two CHM files. As the PDFs are part of the CHM, you can forget about them.

Either way, the overall disk real estate would be about the same. Maybe option two would be less, especially if you use the file compression option in your single source layout.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 06, 2013 Oct 06, 2013

Copy link to clipboard

Copied

Hi,

Thanks for your reply, you made point more clear..

As mentioned by you, we have 2 choices. Can you take some time to tell me the process for choice 1, please?

"Package up the 300+ PDFs in the install together with the CHMs. The link path to the PDFs would just be <filename>.pdf. However this has the drawback that the link would be broken if the PDF or CHM were ever moved from their original location." - How can this be done? Well, to address the issue of broken links, we will not change the location of pdfs / chms. So the location would remain same all the time.

And also, I got a personal reply for one of this forum members. This link "External Files Link" was provided by thim. I guess this works...(I dont know coding)

Regards.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 14, 2013 Oct 14, 2013

Copy link to clipboard

Copied

Prateek.T wrote:

Hi,

Thanks for your reply, you made point more clear..

As mentioned by you, we have 2 choices. Can you take some time to tell me the process for choice 1, please?

"Package up the 300+ PDFs in the install together with the CHMs. The link path to the PDFs would just be <filename>.pdf. However this has the drawback that the link would be broken if the PDF or CHM were ever moved from their original location." - How can this be done? Well, to address the issue of broken links, we will not change the location of pdfs / chms. So the location would remain same all the time.

And also, I got a personal reply for one of this forum members. This link "External Files Link" was provided by thim. I guess this works...(I dont know coding)

Regards.

I think Colum is saying build a chm with relative links to the pdfs that just contain the pdf file names. Then install both the chm and the PDFs into a single folder. As long as the pdfs and the chm remain in the same folder together, the pdfs should open up fine once the link is followed from the chm.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 04, 2013 Oct 04, 2013

Copy link to clipboard

Copied

Hi there

As we are talking about CHM files here, I like to use the HTML Help Shortcut control to open external files. You just supply the file name of the PDF as the target for the control. That way the PDF may be kept outside of the CHM if you want.

The only real side effect is a phenomenon that happens with CHM files when they are linked to the application. You may find that the actual folder that the help "sees" has changed, due to the way the developers have linked the CHM. And that's why we find folks using the JavaScript outlined at the link below to accomplish this.

Click here to view

Cheers... Rick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 06, 2013 Oct 06, 2013

Copy link to clipboard

Copied

Hi captive8r,

Thanks for your reply.

Well, we dont really link our chm files to the application. As mentioned in my previous replies, we deliver a set of 300+ pdf's and 2chms as a single folder. You mentioned a point about HTML Help Shortcut Control.

"I like to use the HTML Help Shortcut control to open external files. You just supply the file name of the PDF as the target for the control." -  Can you explain, how this works?

Regards.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 14, 2013 Oct 14, 2013

Copy link to clipboard

Copied

Prateek.T wrote:

Hi captive8r,

Thanks for your reply.

Well, we dont really link our chm files to the application. As mentioned in my previous replies, we deliver a set of 300+ pdf's and 2chms as a single folder. You mentioned a point about HTML Help Shortcut Control.

"I like to use the HTML Help Shortcut control to open external files. You just supply the file name of the PDF as the target for the control." -  Can you explain, how this works?

Regards.

Select Insert | HTML Help Controls | Shortcut. The Shortcut Wizard appears. In Shortcut, type the text for the linking text to use, and click Next. In Program to run when shortcut is activated, type the name of the PDF filename to open. Just the name. Continue through the Wizard. A button appears with the linking text on it. Place the PDF in the same directory as the compiled chm. The PDF opens when you click on the button.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 15, 2013 Oct 15, 2013

Copy link to clipboard

Copied

Hi JaredHess,

Thanks for your new tip. That worked fine, but it is either a button or an image. We need text based hyprlink.

However, we could write some code. And it worked partially fine.

But, if you can assist me in another issue, please help me out.

Issue: The pdfs are getting pulled dynamically, but only in the preview mode.

When I tried to generate a chm file, I am able to click the link, but the link is not triggering any file.

Note When I see the properties of the link in the output file, it is showing correct path.

Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 16, 2013 Oct 16, 2013

Copy link to clipboard

Copied

How are you linking to the PDFs? Are you using the above Shortcut method?
Can you post the HTML code and any scripting you're using?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 16, 2013 Oct 16, 2013

Copy link to clipboard

Copied

Hi JeradHess,

My issue got cleared and its dynamically pulling the pdf file from the desired location.

However for your reference, the following is a javascript file. MyConfig.js

function myFunction()

{

var sHref = document.getElementById('link').href;

sHref  = sHref.substring(sHref.lastIndexOf('/') + 1);

var path = "file://Server location";

sHref  = path.concat(sHref);

document.getElementById('link').href = sHref;

}

----

This is the html content in the tool.

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Adobe RoboHelp 10" />
<title>Oscar Award</title>
<link rel="StyleSheet" href="default.css" type="text/css" />
</head>

<body>
<script src="MyConfig.js" type="text/javascript"></script>
<h1 style="color: #008080;">Oscar Award</h1>
<p><img src="Camera.jpg" alt="" style="border: none;" width="80" height="85"
   border="0" />The Academy Awards, commonly known as <span style="font-weight: bold;">The
Oscars</span>, are a set of awards given annually for excellence of cinematic
achievements. The Oscar statuette is officially named the Academy Award
of Merit.</p>
<p>&#160;</p>
<p>For more info on Oscars --&gt;

<a id="link" href="Oscars.pdf" onclick="myFunction()" target="_blank">Oscars and Details</a>

</p>
</body>
</html>

---

Bolded words description...

  1. The scricpt src calls the .js file.
  2. The .js file is added as a baggage file to the robohelp project.
  3. Place all the pdf files in the sever location. (ex. Oscars.pdf, booker.pdf, nobel.pdf, etc.)
  4. sHref  = path.concat(sHref); --> This will cancatenate the server location and the file name and then pulls the desired file (oscars.pdf in this case)
  5. When you click on Oscars hyperlink, the myFunction() method of MyConfig.js is called.

Note: Make sure the user has all rights to the server. (read / write / copy - Full Access)

This helped me.

Regards.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 17, 2013 Oct 17, 2013

Copy link to clipboard

Copied

LATEST

Thanks for sharing. Glad things are working for you now.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp