Как запустить xpdf (1) без панели структуры?

677
Mateusz Piotrowski

Я пытаюсь настроить xpdf (1), чтобы он не отображал панель схемы по умолчанию.

Мне удалось настроить привязку клавиш в моем, ~/.xpdfrcчтобы переключить видимость панели структуры с этой командой:

bind t any toggleOutline 

Я не смог понять, как отключить панель контуров по умолчанию. Я нашел руководство по файлу конфигурации для инструментов Xpdf, но это не помогло.


xpdf window

Схема - это панель слева. (Фигура взята из Википедии.)

0

2 ответа на вопрос

1
Argonauts

The current release of xpdf (v3.04) does not have a configuration setting (xpdfrc) or command line flag to disable the outline that will appear if a pdf has embedded bookmarks.

The method you are using is the only way - with similar variants such as binding a key to 'closeOutline' - that is possible. Assuming that using a more robust / maintained pdf reader is not an option e.g. okular or evince, then the best option I can offer up is a tiny source code change that will disable outlining.

You can rebuild xpdf with outline mode disabled; it's a trivial change to the build. However it does require that a number of dependencies be installed and that you have some experience in building a project from source. The basic process is as follows (I am assuming you are running linux here; xpdf runs on nearly all platforms...)

modify and rebuild from source

#create a working directory: mkdir ~/xpdf-build cd ~/xpdf-build # download the source code wget ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.04.tar.gz # extract it tar xzvf xpdf-3.04.tar.gz cd xpdf-3.04 # edit a header file to disable outlining - substitute vi with your editor of choice vi xpdf/config.h # After the line #define CONFIG_H, insert the following new line (the # is not a comment in this case - you need to have that) #define DISABLE_OUTLINE #then close and save the file #type ./configure # This will check your build environment and identify any missing dependencies # It could get messy depending on your distro. Assuming that works, then make # Before installing you should uninstall the xpdf installed by your package manager to prevent any conflicts; then type the following to install: sudo make install 

If you've never built software from source before, this may be a bit of a challenge. I checked this out on fedora 24 beta, and had issues with one dependency (freetype2) that were difficult to address. I was able to build it and confirm that the outline does not appear with this change - ever; which could be an issue for you if you ever do want an outline.

If you have issues, respond with your distro and revision; I may be able to offer up some additional help.

Edit: Since you are building a customized version of xpdf, it wouldn't be a big effort to add a command line flag to the xpdf program to enable/disable automatic outlining. Obviously it requires C++ coding experience; but I meant to offer this as an option. If done well, a pull request (or whatever the equivalent is since they aren't using git) should be sent to the maintainer, as google indicates that you aren't alone in wanting this capability.

Check here for some common build issues: http://www.foolabs.com/xpdf/problems.html

Я использую FreeBSD 10.3, поэтому я могу легко собрать там xpdf из портов. Спасибо за этот отличный ответ. Я обязательно постараюсь изменить исходный код и собрать его, если найду время. Ура! Mateusz Piotrowski 7 лет назад 0
Я пытался собрать: ./configure.h вернул: `configure: WARNING: не удалось найти Motif configure: WARNING: не удалось найти FreeType configure: WARNING: - вы сможете скомпилировать pdftops, pdftotext, pdfinfo, pdffonts , pdfdetach и pdfimages, но не xpdf или pdftoppm`, тогда, когда я запустил make install, я получил `mkdir -p / usr / local / bin / usr / bin / install -c xpdf / pdftops / usr / local / bin / pdftops / usr / bin / install: невозможно указать 'xpdf / pdftops` Нет такого файла или каталога Makefile: 85: ошибка рецепта целевой установки' Но pdftops находится в / usr / bin. Не могли бы вы, пожалуйста, посоветуйте Leo Simon 7 лет назад 0
http://unix.stackexchange.com/questions/187752/xpdf-configure-warning-couldnt-find-motif-x Argonauts 7 лет назад 0
1
Benben

Из этой превосходной статьи: https://www.xpdfreader.com/xpdfrc-man.html

Включите в ~/.xpdfrcфайл следующую строку :

initialSidebarState no