CHM external link with ampersand - chm

I'm building a CHM file with many external links. The links are in the Index.hhk and are supposed to display the external page in the CHM help.
All the links are something like this: http://dle.rae.es/srv/search?m=30&w=casa
As you see the path has the symbol & in it, and apparently CHM cannot handle it. All the links are cut down to " http://dle.rae.es/srv/search?m=30? " by HTML Help Workshop.
Is there a way to fix this?
I tried with %26, but it doesn't work.

This is a bit complicated and is related to the behavior of the HTMLHelp Workshop. Please remember, HTMLHelp (CHM's) is nearly 20 years old and Microsoft's Windows based help system is in "maintenance mode" only. Some characters are handled in a special way and this leads to problems especially with file names.
So, e.g. a hash (#) is a registered character which is used for hyperlinks. This character can not be used (as well as "?","&" and "+" characters). All those have special meaning.
We should address your problem now and a solution for your index.hhk and HTMLHelp Workshop. You may know the index.hhk file is a text file (old sitemap format) and can be edited by a plain text editor like NotePad++
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<meta name="GENERATOR" content="Microsoft® HTML Help Workshop 4.1">
<!-- Sitemap 1.0 -->
</HEAD><BODY>
<OBJECT type="text/site properties">
<param name="WindowName" value="StackOverflow">
</OBJECT>
<UL>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Ampersand-casa">
<param name="Local" value="http://dle.rae.es/srv/search?m=30&w=casa">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Ampersand-cerveza">
<param name="Local" value="http://dle.rae.es/srv/search?m=30&w=cerveza">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Welcome">
<param name="Local" value="index.htm">
</OBJECT>
</UL>
</BODY></HTML>
So, you may search and replace & with & using a regular expression and your prefered text editor like shown above. Using %26 leads to a server error using your sample URL from a compiled help file (*.CHM).
Please note - opening index.hhk by HTMLHelp Workshop shortens the URL again as you have already seen. So you need to clean up your index.hhkand compile immediately afterwards without opening your index.hhk.
As shown in the snap below it's resulting in a content pane for your needs.

Related

How to Set the link for "Home" button for CHM file?

I create a CHM help document with HTML Workshop. However, when click the "Home" button in the navigator bar, I will see this:
Our homepage will be distorted completely.
I try to find a way to set the "Home" button link but cannot a way. Finally I open .hhp file and edit the following line:
[WINDOWS]
main="DataNumen Outlook Repair","DOLKR.hhc","DOLKR.hhk","introduction.htm","https://www.datanumen.com/",,,,,0x62520,,0x3046,[0,0,780,660],,,,,,,0
But after that, when I click the "Home" page, I will get the following error:
So how to solve the problem?
The chm file(version 1) can be downloaded from https://www.datanumen.com/temp/20210113/DOLKR.chm
The short story - AFAIK it's not possible linking to a domain or an exact location from the CHM's home button by full path URL.
CHM files offer the preferred option of the "Default Topic file" (e.g. "introduction.htm"). The "Home" button can also be suppressed by special settings, but is useful for returning to "Home" if you have previously navigated different topics. In the sense of a homepage of the HTML help file "web" this can be a "home.htm" or even the "introduction.htm".
My suggestion as a simple workaround is to create a nice home.htm and link from there to your own company page in a new browser window.
[WINDOWS]
main="DataNumen Outlook Repair","DOLKR.hhc","DOLKR.hhk","introduction.htm","home.htm",,,,,0x62520,0,0x3046,[0,0,780,660],0xB0000,,,,,0,
As mentioned by others CHM files were developed over 20 years ago and are usually only used as a local help file. The system requires Internet Explorer. You can't access complex web pages because of the outdated Internet Explorer browser.
It is possible to link to simple HTML pages on the internet via the table of contents file (.hhc) as shown below. Please keep in mind that a customer using a local CHM help file requires an internet connection.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<meta name="GENERATOR" content="Microsoft® HTML Help Workshop 4.1">
<!-- Sitemap 1.0 -->
</HEAD><BODY>
<UL>
<LI><OBJECT type="text/sitemap">
<param name="Name" value="Jump directly from here (help-info.de)">
<param name="Local" value="https://www.help-info.de/index.htm">
<param name="ImageNumber" value="13">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Introduction">
<param name="Local" value="introduction.htm">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="System requirements">
<param name="Local" value="requirements.htm">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Usages">
</OBJECT>
<UL>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Repair file">
<param name="Local" value="repairfile.htm">
</OBJECT>
...
The Microsoft HTML help viewer used to display CHM help files is very old and not maintained by Microsoft anymore: it is using an older version of Internet Explorer to display topic content and external URLs which might break modern web-sites, and I suspect that this is the cause of your problem.
Some possible solutions include:
You can create a specific page for your web-site which work on older versions of Internet Explorer and link to that page instead
You can create a link to a _blank target which will open that page in your standard web-browser instead of the Microsoft HTML help viewer

How integrate HTML5 <video> tag in JSF/Facelets?

I want to use HTML5 <video> tag inside a JSF/Facelets page. I tried the following, but it does not work.
<h:body>
Hello from Facelets
<br />
<section id="reproductor">
<video src='http://minkbooks.com/content/trailer.mp4' >
</video>
</section>
<h:link outcome="welcomePrimefaces" value="Primefaces welcome page" />
</h:body>
JSF is in the context of this question merely a HTML code generator. So, JSF is actually completely irrelevant in the concrete problem. You would have had exactly the same problem when using e.g. JSP, ASP, PHP etc to produce HTML code, or even when using a static HTML file.
Coming back to your concrete problem, provided that your browser supports the HTML5 tags in question, then your concrete problem is simply caused because you're trying to stream a video cross-domain. This is not supported by <video> nor <audio> tag. You need to provide the video file from your own domain (i.e. put the file in the very same webapp as where your JSF file is).
Assuming that you've put a copy of the video file in the same folder as the JSF file, this should do:
<video src="trailer.mp4" />
In addition of #BalusC response above, dont forget to map the file type for your static content in the deployment descriptor (web.xml). Here are the lines:
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.mp4</url-pattern>
</servlet-mapping>

A relative path to a file in parent directory in HTML Help Workshop

The relative paths to parent directories either in the *.hhc file or in the html code of the help page .htm does not work in compiled .chm help file.
In this example, file1.htm is in the same directory as the *.hcc file, whereas file2.htm is in other directory that needs to be accessed via parent directory. The HELP Workshop IDE creates following *.hhc:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<HTML>
<HEAD>
<meta name="GENERATOR" content="Microsoft® HTML Help Workshop 4.1">
<!-- Sitemap 1.0 -->
</HEAD><BODY>
<OBJECT type="text/site properties">
<param name="ImageType" value="Folder">
</OBJECT>
<UL>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Introduction">
<param name="Local" value="file1.htm">
</OBJECT>
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Topic">
<param name="Local" value="..\common\file2.htm">
</OBJECT>
</UL>
</BODY></HTML>
The content of the file 1 begins with something like this:
<html>
<head>
<title>Documentation</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0" />
<link rel="stylesheet" type="text/css" href="..\common\webformat.css" />
<script language="JavaScript" type="text/javascript" src="..\common\WindowControl.java">
</script>
</head>
<body>
<table cols=2>
<tr>
<td align="left" valign="bottom"><h2>Overview</h2></td>
<td align="right"><img src="..\common\images\klein.gif" alt="Logo"></td>
</tr>
</table>
In the compiled *.chm file the stylesheet is not applied, javascript does not work and images are not displayed. The file2 from the table of content is not accessible as well.
Decompressing the *.chm file with 7zip it is can be seen that the compiler placed all files on the same level, but it left the relative paths in *.htm files and *.hhc files unchanged. That is why they are not accessible:
Help folder hierarchy in the help project:
Help
|-common
| |-file2.htm
| |-webformat.css
| |-WindowControl.java
| |-images
| |-klein.gif
|-private
|-file1.htm
And in the decompressed *.chm file hierarchy:
Help
|-file1.htm
|-file2.htm
|-webformat.css
|-WindowControl.java
|-klein.gif
Specifying alternative paths to all relative paths by javascript is a very unclean solution. Moreover, it does not solve the problem of the links in the *.hhc file.
Any ideas?
Paths should be relative to the root of the directory, and URLs use FORWARD slashes.
All paths in configuration files should be relative to the document root. So if the HELP directory is visible in the CHM, the parent of help is the documentroot, and project files of the CHM project are like help/common/xxx.gif.
Afaik in html files, urls can be relative, maybe it stumbles on the wrong slashes.
(p.s. To view the internal structure of CHMs I use the "chmls" command from Free Pascal, but iirc some of the *nix CHM viewers also display paths)
I had a similar problem and I found a work-around for my case. I wanted my project to be available on a network share and so I created my *.hhp file in a directory on that share. I tried for a long time to get the HHP software to find my very simple HTML files, which were in sub directories from the HHP file, but with no success. I ended up creating my HHP project on my local C drive. When I did that, I could access support files from anywhere on our network. It is to my advantage to leave my HTML, CSS etc. files on the share, but they could be anywhere. The only downside is that after you compile your project you have to copy the *.chm file to the location you want it to be, but that is not a major inconvenience. You might even create a simple .bat file for the job.

how to display excel sheet in html page

I want to display EXCEL sheet embedded in IE with plain HTML. I have gone through other questions on stackoverflow but could not find any useful one.
Here is my html file
<html>
<body>
<object width = 900 height = 500 id = "excel" data="Issues Identified.xlsx" classid = "clsid:0002E55a-0000-0000-C000-000000000046" VIEWASTEXT >
<param name="DisplayTitleBar" value=true />
<param name="DataType" value="CSVURL"/>
<param name="AutoFit" value="0"/>
<param name="DisplayColHeaders" value="1"/>
<param name="DisplayGridlines" value="1"/>
<param name="DisplayHorizontalScrollBar" value="1"/>
<param name="DisplayRowHeaders" value="1"/>
<param name="DisplayTitleBar" value="1"/>
<param name="DisplayToolbar" value="1"/>
<param name="DisplayVerticalScrollBar" value="1"/>
<param name="EnableAutoCalculate" value="0"/>
<param name="EnableEvents" value="0"/>
<param name="MoveAfterReturn" value="1"/>
<param name="MoveAfterReturnDirection" value="0"/>
<param name="RightToLeft" value="0"/>
</object>
</body>
</html>
Unfortunately I do not have control on the excel files that are generated. If I would have control on the excel files I could have have saved them as web pages and included in the browser. Now I doubt if by any way through above code I can embed excel sheet directly in the web browser. There are many links on web but found not find one which directly loads a excel sheet in to the browser. The ones that are there are using javascript to generate graphs and all instead of displaying an excel sheet which is already present.
When I try to load the excel sheet through above code. I get the following screen
When I use IFRAME the excel sheet is not shown as embedded file but prompting to download or open. I want it to open embedded in the internet explorer.
Any help much appreciated.
Thanks
Depending on if you want it to automatically update or not, you can just save the excel spreadsheet as a PDF then embed the PDF as an object -
It appears you don't have a PDF plugin for this browser, but you can
click here to
download the PDF file.
It's the best way I have found for uploading.
You can upload it into Google Docs, and embed the Google Spreadsheet as detailed here: http://support.google.com/docs/bin/answer.py?hl=en&answer=55244
Upload your file to Skydrive and then right click and select "Embed". They will provide iframe snippet which you can paste in your html. This works flawlessly.
Source: Office.com
Like you, I cannot get MS Office Web Components to work. I would not consider Google Docs since Google seems to think they own anything that passes through their hands. I have tried MS Publish Objects but the quality of the generated html/css is truely awful.
The secret of converting an Excel worksheet to html that will display correctly on a smartphone is to create clean, lean html/css.
The structure of the HTML is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
HEAD
</head>
<body>
BODY
</body>
</html>
There are useful html elements that can replace "HEAD" but it is not clear to me how you would generate them from an Excel worksheet. They would need to be added separately.
The obvious output for a worksheet or a range is an html table so the following assumes BODY will be replaced by an html table.
The structure of an html table is:
<table TABLE-ATTRIBUTES>
<tr TABLE-ROW-ATTRIBUTES>
<td TABLE-CELL-ATTRIBUTES>CELL-VALUE</td>
More <td>...</td> elements as necessary
</tr>
More <tr>...</tr> as necessary
</table>
Include as few TABLE-ATTRIBUTES, TABLE-ROW-ATTRIBUTES and TABLE-CELL-ATTRIBUTES as possible. Do not set column widths in pixels. Use css attributes rather than html attributes.
A table attribute worth considering is style = "border-collapse: collapse;". The default is separate with a gap around each cell. With collapse the cells touch as they do with Excel.
Three table attribute worth considering are style="background-color:aliceblue;", style="color:#0000FF;" and style="text-align:right;". With the first, you can specify the background colour to be any of the fifty or so named html colours. With the second, you can specify the font colour to be any of 256*256*256 colours. With the third you can right-align numeric values.
The above covers only a fraction of the formatting information that could be converted from Excel to html/css. I am developing an add-in that will convert as much Excel formatting as possible but I hope the above helps anyone with simple requirements.
Office 365 and OneDrive offer an embed feature. You can then include via IFrame.
I found that setting the iframe height and width to 100% works best. That way on ipad or any device for that matter it fits the screen.
<body style="margin:0px;padding:0px;overflow:hidden">
<iframe src="embed url" frameborder="0" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;height:100%;width:100%;position:absolute;top:0px;left:0px;right:0px;bottom:0px" height="100%" width="100%"></iframe>
</body>
You can use iPushPull to push live data direct from an Excel session to the web where you can display it in an IFRAME (or using a WordPress plugin, if applicable). The data in the frame will update whenever the data on the sheet updates.
The iPush(...) in-cell function pushes data from Excel to the web.
This support page describes how to embed your Excel data in your website.
Disclaimer - I work for iPushPull.
Note that Office Web Components are dead, see does-office-xp-web-components-compatable-with-windows-7. OWC was discontinued from XP onward for security reasons.
Since then, and only recently, Microsoft pushes Excel Web App as alternative (a poor alternative IMHO)
As a side note: Microsoft also deprecated the other way round, i.e. embedding the webbrowser control into an excel sheet, see adding-web-browser-control-to-excel-2013.
As an alternative Microsoft offers Office Apps (a very limited alternative with respect to interfacing Excel and IE)
Maybe you might try the web to send the file with proper Content-Type header and with the header like this:
Content-Disposition: inline; filename="xxx.xxx"
Here is a discussion about these headers: How to force files to open in browser instead of download (pdf)?
Or just search on google for content-disposition.
If you are making a link <a href='file.htm'>link name</a> or place an iframe tag, it will show the excel data on web but you can't make changes to it.
Every time you make changes in the Excel sheet you have to save again with the same name so it will replace file, and will show the result. The <a> tag file name extension should be .htm
from here you can easily convert your excelsheet data into the html view
Try this it will work...
<iframe src="Tmp.XLS" width="100%" height="500"></iframe>
But you can not save changes that you have done...It is used only for displaying purpose..

Flash SWF file cannot find XML data file when loaded into WebBrowser control (but works in IE9)

Bit of a long explanation below, with a hopefully accurate short question summary here:
Can a .NET WebBrowser control (Win7 64-bit, IE9, current Flash 10.3.183.7) load a SWF file into an <object> tag, where the SWF file is in a separate folder that also contains an XML data file in such a way as to have the SWF file load and display the XML data?
UPDATE: Added some more information below based on some further experimentation...
Gory detail:
This has plagued me for a couple of days. Consider the following:
C:\dev\wb.exe -- program that uses a WebBrowser to show a local SWF file from the disk
c:\data\mySWF.swf -- the SWF file I want to play
c:\data\myData.xml -- the file with data that mySWF.swf is looking for
C:\html\index.html -- HTML file loaded by wb.exe. This file has an <object> tag to set up a Flash ActiveX control playing c:\data\mySWF.swf.
Originally, this started with swfobject.js being used, and when I didn't see the results I was expecting, I kept simplifying until I got to the point where I don't have anything but an HTML file with no additional libraries.
If I load the index.html into IE9, it works. I see the SWF file playing with the data from the XML file loaded.
When I run wb.exe, it loads the C:\html\index.html file, and I see the SWF playing. But the data fields are empty. If I copy the index.html to C:\data\index.html and load it into wb.exe, THEN I see my data.
My index.html file:
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
* {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
</style>
</head>
<body MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" RIGHTMARGIN="0" TOPMARGIN="0" BOTTOMMARGIN="0">
<object type="application/x-shockwave-flash" width=100%" height="100%" id='player1' name='player1'>
<param name='movie' value='C:\data\mySWF.swf'>
<param name='allowfullscreen' value='true'>
<param name='allowscriptaccess' value='always'>
<param name='base' value='C:\data\'>
<param name='menu' value='false'>
<param name='quality' value='best'>
<param name='scale' value='exactfit'>
</object>
</body>
</html>
The base parameter seemed to be part of getting this to work, but I'm stymied as to why (or whether) I can get the Flash ActiveX control to work the way I need it to, without having to load an HTML file from the same folder as the SWF file.
UPDATE: If I put the myData.xml file into the C:\html folder, and I load from C:\html\index.html, I get the data values in the SWF. So it seems that the Flash plug-in is using the path of the index.html file, and NOT the base parameter.
UPDATE: We've found out, through more experiementation, that this problem does NOT appear to occur if the SWF file uses Action Script 2 (AS2) for its XML handling (via XML.load()), but a SWF file using Action Script 3 (AS3) (via URLLoader.load()) does NOT work properly. This just gets weirder.
I appreciate your patience if you stuck around this far, and hopefully you might be able to educate me as to my problem.
Thanks.
As a follow-up to my own question, there's no nice solution.
We worked around the issue by using jQuery to adjust a <base href="">tag in the main HTML to refer to the folder with the SWF and XML file in, each time we loaded a new SWF file. That works, but no one's really happy with it.
We talked to Microsoft, and then to Adobe. Adobe calls the use of Flash in a .NET WebBrowser control an "unsupported use case" and doesn't want anything more to do with the issue.