Как открыть и преобразовать документы CHM?

После использования Universal-USB-Installer вам нужно будет изменить txt.cfg и text.cfg, чтобы включить постоянство в конце каждой из загрузочных строк, заканчивающихся на «-»

Например [ ! d1]

..... boot = casper quiet splash - persistent

Мое предположение заключается в том, что Universal-USB-Installer не может добавить «постоянный» в конец cfg-файлов во время процесс установки.

1
задан 3 January 2017 в 22:19

5 ответов

Если вы не хотите использовать PDF, я бы предложил Epub, довольно хороший, открытый формат электронной книги, вы можете установить хороший читатель для него под названием Caliber on Ubuntu, у Caliber есть полезное средство конвертации, которое может импортировать chm файлы, а затем конвертировать их в другие форматы epub. epub можно легко прочитать на большинстве смартфонов и планшетов.

Калибр можно установить из программного центра.

3
ответ дан 25 May 2018 в 22:48

Также есть KChmViewer, если вы предпочитаете KDE.

1
ответ дан 25 May 2018 в 22:48
  • 1
    KChmViewer - это хорошо. но я бы предпочел аддон Firefox [CHM Reader]. Нехорошее решение для моей проблемы, поскольку я хочу избавиться от этих паршивых файлов chm, у меня уже есть лучший формат. Pdf тоже нехорошо. Опции? – Julio 27 February 2011 в 11:05

На Android также есть xchm и несколько читателей chm.

1
ответ дан 25 May 2018 в 22:48

Вино достаточно.

Затем: Откройте его с помощью этого мягкого

0
ответ дан 25 May 2018 в 22:48

dv3500ea имеет отличный ответ chm2pdf, но я предпочитаю читать их как html-файлы.

Короче:

sudo apt-get install libchm-bin
extract_chmLib myFile.chm outdir

Источник: chm2pdf answer

Затем откройте ./outdir/index.html, чтобы просмотреть преобразованные html-файлы ! Yaaay! Намного лучше. Теперь я могу перемещаться по нему, как файл .chm, но я также могу использовать браузер Chrome для поиска страниц для текста, легко распечатать и т. Д.

Давайте сделаем команду под названием chm2html [!d6 ]

Вот хороший сценарий, который я написал.

Скопируйте и вставьте приведенный ниже скрипт в файл chm2html.py Сделайте его исполняемым: chmod +x chm2html.py Создайте каталог ~/bin, если у вас еще нет one: mkdir ~/bin Создайте символическую ссылку на chm2html.py в каталоге ~/bin: ln -s ~/path/to/chm2html.py ~/bin/chm2html Выйдите из Ubuntu, затем войдите в систему или перезагрузите свои пути с помощью source ~/.bashrc Используйте его! [F12]. Это автоматически преобразует файл .chm и помещает файлы .html в новую папку с именем ./myFile, затем создает символическую ссылку, называемую ./myFile_index.html, которая указывает на ./myFile/index.html.

chm2html.py файл:

#!/usr/bin/python3

"""
chm2html.py
- convert .chm files to .html, using the command shown here, with a few extra features (folder names, shortcuts, etc):
http://www.ubuntugeek.com/how-to-convert-chm-files-to-html-or-pdf-files.html
- (this is my first ever python shell script to be used as a bash replacement)

Gabriel Staples
www.ElectricRCAircraftGuy.com 
Written: 2 Apr. 2018 
Updated: 2 Apr. 2018 

References:
- http://www.ubuntugeek.com/how-to-convert-chm-files-to-html-or-pdf-files.html
  - format: `extract_chmLib book.chm outdir`
- http://www.linuxjournal.com/content/python-scripts-replacement-bash-utility-scripts
- http://www.pythonforbeginners.com/system/python-sys-argv

USAGE/Python command format: `./chm2html.py fileName.chm`
 - make a symbolic link to this target in ~/bin: `ln -s ~/GS/dev/shell_scripts-Linux/chm2html/chm2html.py ~/bin/chm2html`
   - Now you can call `chm2html file.chm`
 - This will automatically convert the fileName.chm file to .html files by creating a fileName directory where you are,
then it will also create a symbolic link right there to ./fileName/index.html, with the symbolic link name being
fileName_index.html

"""


import sys, os

if __name__ == "__main__":
    # print("argument = " + sys.argv[1]); # print 1st argument; DEBUGGING
    # print(len(sys.argv)) # DEBUGGING

    # get file name from input parameter
    if (len(sys.argv) <= 1):
        print("Error: missing .chm file input parameter. \n"
              "Usage: `./chm2html.py fileName.chm`. \n"
              "Type `./chm2html -h` for help. `Exiting.")
        sys.exit()

    if (sys.argv[1]=="-h" or sys.argv[1]=="h" or sys.argv[1]=="help" or sys.argv[1]=="-help"):
        print("Usage: `./chm2html.py fileName.chm`. This will automatically convert the fileName.chm file to\n"
              ".html files by creating a directory named \"fileName\" right where you are, then it will also create a\n"
              "symbolic link in your current folder to ./fileName/index.html, with the symbolic link name being fileName_index.html")
        sys.exit()

    file = sys.argv[1] # Full input parameter (fileName.chm)
    name = file[:-4] # Just the fileName part, withOUT the extension
    extension = file[-4:]
    if (extension != ".chm"):
        print("Error: Input parameter must be a .chm file. Exiting.")
        sys.exit()

    # print(name) # DEBUGGING
    # Convert the .chm file to .html
    command = "extract_chmLib " + file + " " + name
    print("Command: " + command)
    os.system(command)

    # Make a symbolic link to ./name/index.html now
    pwd = os.getcwd()
    target = pwd + "/" + name + "/index.html"
    # print(target) # DEBUGGING
    # see if target exists 
    if (os.path.isfile(target) == False):
        print("Error: \"" + target + "\" does not exist. Exiting.")
        sys.exit()
    # make link
    ln_command = "ln -s " + target + " " + name + "_index.html"
    print("Command: " + ln_command)
    os.system(ln_command)

    print("Operation completed successfully.")
0
ответ дан 25 May 2018 в 22:48

Другие вопросы по тегам:

Похожие вопросы: