用Java打开一个CHM文件-请帮助 [英] Open a chm file in java - help please

查看:92
本文介绍了用Java打开一个CHM文件-请帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我想从我的Java应用程序中打开CHM(帮助)文件...
我的代码如下所示:

Hello,
I want to open a CHM (help) file from my java application...
My code looks like that:

Runtime.getRuntime().exec("hh.exe myhelpfile.chm");


它可以工作,但是如何在特定页面上打开它呢?

谢谢,
Tom:)


It works, but how can i open it with a specific page??

Thanks,
Tom :)

推荐答案

实际上,根据tvizel88的评论,我能够使它成功运行;关键问题是HTML通常不缓存在/the/full/path/form中的CHM文件中.
如果您按照他的建议去做,但是使用帮助创建软件中指定的主题ID,那应该会更好(至少对我有用).
如果遇到问题,请按照Richard MacCutchan的建议进行操作,然后在命令行中尝试将Java排除在外.
这对我来说很好:
hh.exe UserManual.chm ::/Using_This_Help_System.htm
我正在使用帮助和手册5生成了CHM文件,而Using_This_Help_System却显示为主题ID,即使它实际上是在目录中嵌入了几层.最初,我试图包含TOC所隐含的完整路径,但这根本不起作用.
I was actually able to get this to work successfully based on tvizel88''s comment; the critical problem is that the HTML is not usually cached in the CHM file in /the/full/path/form.
If you do as he suggests, but using the topic ID specified in the help creation software, that should work better (at least it did for me).
If you are having trouble, do as Richard MacCutchan suggests and try it from the command line, to take Java out of the equation.
This worked fine for me:
hh.exe UserManual.chm::/Using_This_Help_System.htm
I am using Help & Manual 5 to produce the CHM file, and Using_This_Help_System shows up as the topic ID, even though it is actually embedded a couple layers down in my table of contents. I was initially trying to include the full path implied by the TOC, and that didn''t work at all.


您需要阅读文档以了解是否可以从命令行指定页面. Java显然不知道它在做什么,它只是传递一个运行命令.
You''d need to read the docs to find out if you can specify a page from the command line. Java plainly has no idea what it is doing, it''s just passing on a run command.


我发现了这样的东西:
I have found something like that:
Runtime.getRuntime().exec("hh.exe myhelpfile.chm::/path/to/my/page.htm");



但这对我不起作用.
在Java中没有针对该问题的解决方案吗?



but it doesn''t work for me.
Is there no solution for that problem in java?


这篇关于用Java打开一个CHM文件-请帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆