DJVIEW4(1)

okay bestie, grab a snack πŸ“ because we're about to get into djview4 β€” the standalone DjVu viewer from the DjVuLibre gang, hanging out in section 1 of your manual. she's long, she's iconic, and this is part 1 of 3, so pace yourself πŸ’…


✨ NAME ✨

djview4 β€” the standalone DjVu viewer. that's it, that's the whole vibe πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

djview4 [options] [argument]

🌸 DESCRIPTION 🌸

So. djview4 is a standalone viewer for DjVu files, and she does NOT come to play. the feature list is genuinely stacked, no cap:

  • navigating documents
  • zooming and panning page images
  • producing and displaying thumbnails
  • displaying document outlines
  • searching documents for particular words in the hidden text layer
  • copying hidden text to the clipboard
  • saving pages and documents as bundled or indirect multi-page files
  • printing page and documents

and the flex on top of the flex? the viewer can simultaneously display several pages using a side-by-side or a continuous layout. multiple pages at once. main character energy, honestly πŸ‘‘


πŸ’– COMMAND LINE ARGUMENT AND OPTIONS πŸ’–

This program can run as a standalone program, OR as a slave process for the DjVu browser plugin nsdejavu. iykyk.

When it's running as a standalone program, the command line argument argument can be any of these cuties:

  • The filename of a valid DjVu document.
  • A local DjVu document URL shaped like this:
file:///path/name.djvu[?djvuopts&keyword=value&...]

the square brackets are just delimiters around the optional components of the URL, they're not part of the URL fr fr. you can specify various options using a syntax similar to that of CGI arguments. doing it this way is very useful for a browser plugin because a plugin has no command line arguments at all. for a standalone viewer though? every option can just be a command line argument, easy peasy.

  • A remote DjVu document URL shaped like this:
http://host/path/name.djvu[?djvuopts&keyword=value&...]

https://host/path/name.djvu[?djvuopts&keyword=value&...]

real talk though: browsing remote DjVu documents with the standalone viewer is less efficient than using the browser plugin. the standalone viewer does not benefit from the browser caching strategies and proxy settings 😭. but it's fine!! proxy settings for the standalone viewer can be set independently with the preferences dialog. problem solved bestie.

An extensive list of options are recognized. Most options can be specified as a command line argument starting with the customary dash character (-), or using the syntax of CGI arguments in the document URL. Some options however are only meaningful as command line arguments. And other options are only recognized when running the X11 version of the djview4 program. so like. read carefully before you start yelling at your terminal πŸ’€


πŸ”₯ COMMAND LINE OPTIONS πŸ”₯

The following options are only meaningful when specified on the command line. these ones need you to actually show up with flags, okay?

  • -help β€” Display a brief help message. when in doubt, ask her directly ✨
  • -verbose β€” Prints informational messages on the console. this option is very useful because it displays messages about the unrecognized constructs in the DjVu annotation and hyperlink layers. it's basically her telling you "bestie, i didn't understand that part" 🫢
  • -fullscreen, -fs β€” Start djview4 in full screen mode. hit the key ESC to exit the full screen mode. (yes, ESC. remember it.)
  • -slideshow[=arg] β€” Start djview4 in slide show mode. the optional numerical argument arg specifies the number of seconds before turning each page. again: use the key ESC to exit the slide show mode. presenting your pages like it's a whole runway show πŸ’…
  • -style=stylename β€” Specify the graphical user interface style. the recognized values for stylename depend on the installed version of the Qt toolkit. common style names include cde, motif, plastique, platinum, and windows. outfit change, but for your GUI πŸŽ€

πŸ‘‘ X11 OPTIONS πŸ‘‘

The following command line options are recognized by the X11 version of the djview4 program. and heads up, this is important: unlike most djview4 options, X11 options that demand an argument do not use the equal character to introduce their argument. no = here, bestie. space it out.

  • -display displayname β€” Specify that the djview4 windows should appear on the X11 display displayname.
  • -geometry WxH+X+Y β€” Specify the initial size and position of the first window using the traditional X11 geometry specification syntax. the numerical arguments W and H represent the initial window width and height. the numerical arguments X and Y indicate the window position relative to the top left corner of the screen.
  • -name name β€” Set the application name.
  • -title title β€” Set the title of the first window.
  • -fn fontname, -font fontname β€” Specify the name of the default font used for buttons and menus. the font should be specified using a X logical font description string.
  • -bg color, -background color β€” Specify the default background color for graphical user interface elements. the color should be given as a standard X11 color name.
  • -fg color, -foreground color β€” Specify the default foreground color for graphical user interface elements. the color should be given as a standard X11 color name.
  • -btn color β€” Specify the default button color. the color should be given as a standard X11 color name.
  • -ncols count β€” Limit the number of colors allocated on a 8 bit display. the default color cube contains 216 distinct colors.
  • -cmap β€” Force the allocation of a private color map on a 8-bit display. this might increase the color quality but cause flashing when the viewer window gets activated. so like, prettier colors, but she will blink at you. your call 🌈

🌈 GENERAL OPTIONS 🌈

The following options can be specified as command line options, OR they can be passed by augmenting the document URL using a syntax similar to that of CGI arguments:

http://.../file.djvu?djvuopts&key=value&key=value&...

In order to separate real CGI arguments from these options, the viewer only recognizes keywords that appear after the word djvuopts. and the keywords key are derived from the option names by removing the initial dashes. so -page becomes page, etc etc. slay.

  • -page=pagename β€” Display a specific document page. the search order goes like this, bestie, follow along:
    1. first, the viewer searches a page whose identifier matches the argument pagename.
    2. otherwise, if pagename is a number preceded by character + or -, the viewer performs a displacement relative to the current page.
    3. otherwise, starting from the current page and wrapping around, it searches for a page whose title matches the argument pagename.
    4. otherwise, if pagename is numerical, it is interpreted as an ordinal page number.
    5. otherwise, and finally, the viewer searches a page whose name matches pagename.

she's thorough. she does not give up on finding your page 🫢

  • -pageno=pagenumber β€” The page searching algorithm for option page can cause ambiguities when page titles can be interpreted as numbers. the argument of option pageno is always interpreted as an ordinal page number. this option is less portable than page because it is not recognized by earlier versions of the djvu plugin. when using this option is necessary, it is advisable to use both the page and pageno options. belt AND suspenders, periodt.
  • -zoom=zoomfactor β€” Specify the initial zoom factor. unless the toolbar, pop-up menu and keyboard are disabled, the user will be able to change the zoom factor. legal values for zoomfactor are shown in the below:
    • number β€” Magnification factor in range 10% to 999%.
    • one2one β€” Select the "one-to-one" mode.
    • width β€” Select the "fit width" mode.
    • page β€” Select the "fit page" mode.
    • stretch β€” Stretch the image to the plugin window size.
  • -showposition=px,py β€” Specify a point in the current page that should be as close as possible to the center of the window. the horizontal and vertical positions px,py in the current page are given as fractions in range 0 to 1. for instance, 0,0 designates the upper left corner of the page, 0.5,0.5 is the center, and 1,1 is the lower right corner. so like. coordinates but make them fractions πŸ’…
  • -mode=modespec β€” Specify the initial display mode. unless the toolbar and pop-up menu are disabled, the user will be able to change it. legal values for modespec are shown in the below:
    • color β€” Display the color image.
    • bw β€” Display the foreground mask only.
    • fore β€” Display the foreground only.
    • back β€” Display the background only.
    • text β€” Overlay the hidden text over the color image.
  • -hor_align=keyword, -halign=keyword β€” Specify the horizontal position of the page in the viewer window. (quick clarification so nobody gets confused: this does not specify what part of the page will be shown, but rather how margins will be laid out around the page in the plugin window.) argument keyword must be left, center, or right.
  • -ver_align=keyword, -valign=keyword β€” Specify the vertical position of the page in the viewer window. (same clarification as above, bestie: this does not specify what part of the page will be shown, but rather how margins will be laid out around the page in the plugin window.) argument keyword must be top, center, or bottom.
  • -cache=(yes|no) β€” Enable or disable the caching of fully decoded pages of the document. caching is on by default. caching of documents whose URL does not contain an extension .djvu or .djv is off by default. sneaky little default, watch out for that one πŸ‘€
  • -continuous=(yes|no) β€” Enable or disable the continuous layout of multipage documents.
  • -sidebyside=(yes|no), -side_by_side=(yes|no) β€” Enable or disable the side-by-side layout of multipage documents.
  • -coverpage=(yes|no) β€” Specify whether the cover page must be displayed alone when multipage documents are shown in side-by-side layout.
  • -righttoleft=(yes|no) β€” Specify whether pages should be arranged right-to-left when multipage documents are shown in side-by-side layout.

and that's part 1, bestie β€” there's more coming, don't go anywhere πŸ¦‹

  • -layout=keyword{,keyword}** β€” set your whole layout vibe with one lil comma-separated list of keywords. here's the menu bestie:
    • single β€” turn OFF side-by-side AND continuous modes πŸ’…
    • double β€” turn ON side-by-side mode 🫢
    • continuous β€” turn ON continuous mode 🌈
    • cover, nocover β€” how the first page gets treated in side-by-side mode
    • ltor, rtol β€” which way the pages flow in side-by-side mode
    • gap, nogap β€” whether there's a lil gap between pages or not
  • -scrollbars=(yes|no) β€” show or hide the scroll bars when the full image is bigger than the plugin window. default is yes ✨
  • -frame=(yes|no) β€” show or hide that thin frame + shadow around the DjVu images. frames are enabled by default πŸŽ€
  • -background=color** β€” pick the color of the background border around the document. color has to be in hexadecimal RRGGBB or #RRGGBB format. no name-colors bestie, we're doing hex only πŸ’…
  • -toolbar=keyword{(,|+|-)keyword}** β€” this one controls how the toolbar looks AND what's on it. the argument is a bunch of keywords separated by comma, plus, or minus. ngl it's giving choose-your-own-adventure.

The appearance is controlled by the keywords that come before the first + or -. here's what's recognized in that context:

  • no β€” no toolbar at all, disable it πŸ’€
  • always β€” always show the toolbar
  • auto β€” toolbar "autohide" mode (not implemented, so don't get too excited)
  • top β€” dock it along the top edge ⬆️
  • bottom β€” dock it along the bottom edge ⬇️

The contents are controlled by keywords after the first + or -. each keyword adds (after a +) or removes (after a -) a specific toolbar button or group of buttons. the initial content is decided by that first + or -: if it's a +, the toolbar starts out empty; if it's a -, the toolbar starts with the default selection of buttons. iconic behavior fr.

Here are the content keywords:

  • modecombo β€” the display mode selection tool
  • zoomcombo β€” the zoom selection tool
  • zoom β€” the zoom buttons
  • select β€” the selection button
  • rotate β€” the image rotation buttons
  • find β€” the text search button
  • new β€” the new window button
  • open β€” the open new document button
  • save β€” the save button
  • print β€” the print button
  • layout β€” the page layout buttons
  • pagecombo β€” the page selection tool
  • firstlast β€” the first-page and last-page buttons
  • prevnext β€” the previous- and next-page buttons
  • backforw β€” reserved for the back and forward buttons
  • help β€” the contextual help button

For the sake of backward compatibility (grandma energy but we respect it 🫢), the keywords fore, fore_button, back, back_button, bw, bw_button, color, and color_button are interpreted like keyword modecombo; the keyword rescombo is a synonym of zoomcombo; the keywords pan, zoomsel, and textsel are interpreted like keyword select; and the keyword doublepage is interpreted like keyword layout. All other keywords are ignored. πŸ’…

  • -menubar=(yes|no) β€” show or hide the menu bar chillin' on top of the window.
  • -statusbar=(yes|no) β€” show or hide the status bar at the bottom of the window.
  • -sidebar=keyword{,keyword}** β€” controls the dockable panels. the argument is a comma-separated list of keywords. a first group of keywords picks which panels are affected β€” omit them and it selects all panels. then a second group controls the visibility and position of the selected panels. two-step slay ✨
    • thumbnails β€” the thumbnail panel
    • outline, bookmarks β€” the outline panel
    • search, find β€” the search panel
    • yes, true β€” show the specified panels (default)
    • no, false β€” hide the specified panels
    • left β€” dock the specified panels on the left side
    • right β€” dock the specified panels on the right side
    • top β€” dock the specified panels on the top side
    • bottom β€” dock the specified panels on the bottom side
  • -thumbnails=keyword{,keyword}** β€” compatibility alias for -sidebar=keyword{,keyword},thumbnails.
  • -outline=keyword{,keyword}** β€” compatibility alias for -sidebar=keyword{,keyword},outline.
  • -menu=(yes|no) β€” enable or disable the pop-up menu.
  • -keyboard=(yes|no) β€” enable or disable the DjVu plugin keyboard shortcuts. default is yes (enabled). ⚠️ heads up bestie: disabling keyboard handling does not disable the shortcuts tied to active menus (see options -menu and -menubar), visible toolbars, and sidebars (see options -toolbar and -sidebar). they got their own thing going on πŸ’…
  • -mouse=(yes|no) β€” enable or disable mouse interaction for panning and selecting. default is yes (enabled).
  • -links=(yes|no) β€” enable or disable hyper-links in the DjVu image. hyper-links are enabled by default πŸ”—
  • -highlight=x,y,w,h[,color]** β€” draw a highlighted rectangle at those coordinates on the current page, in whatever color you picked. x, y, w, and h are measured in document image coordinates, not screen coordinates. the origin sits at the bottom left corner of the image. color must be hexadecimal RRGGBB or #RRGGBB format. you can stack multiple highlighted zones, and you can intersperse them with multiple -page=pagename options πŸŽ€
  • -find=text** β€” highlight every occurrence of the given string text. this one only works when the document has a hidden text layer. pair it with -sidebar=find to pull up the text searching interface πŸ”

The string text can be terminated by a slash (/) followed by letters that specify search options. here's the letter cheat sheet:

  • c β€” case-sensitive search
  • C β€” case-insensitive search (default)
  • w β€” search hits start on word boundaries (default)
  • W β€” ignore word boundaries
  • r β€” regular expression search
  • R β€” string search (default)
  • -rotate=(0|90|180|270) β€” rotate the djvu image by that angle, in degrees, counter-clockwise. spin it bestie πŸŒ€
  • -print=(yes|no) β€” enable or disable printing the DjVu document. printing is enabled by default.
  • -save=(yes|no) β€” enable or disable saving the DjVu document. saving is enabled by default.
  • -passive β€” make the DjVu image display like an ordinary web image. the default zoom factor becomes page. toolbar, status bar, scrollbars, menus, and keyboard shortcuts are all disabled. it's giving minimalism ✨
  • -passivestretch β€” same deal, display like an ordinary web image. but this time the default zoom factor becomes stretch. toolbar, status bar, scrollbars, menus, and keyboard shortcuts are all disabled too.
  • -nomenu, -notoolbar, -noscrollbars β€” these options were recognized by some versions of the DjVu viewers, and they're honored here for backward compatibility. a warning message gets printed when option -verbose is active. πŸ‘€

  • -logo, -textsel, -search β€” okay so bestie, these used to be recognized by some versions of the DjVu viewers, but djview4 does not implement them rn πŸ™ˆ. You'll just get a warning message printed at you when -verbose is active. That's it, that's the whole tea.

πŸŽ€ USAGE πŸŽ€

Okay so most of the good stuff? You get it from the menus, the toolbar, the side bar, or the pop-up menu that shows up when you hold down the right mouse button over a DjVu image. Periodt.

And for the detailed help? Click the contextual help icon in the toolbar, then click around on the various sections of the djview user interface and it'll explain itself to you. Very main character of it honestly. ✨

So here's the table of useful key combos that get recognized when the djvu document is active. Memorize these, they're iconic:

  • SHIFT+F1 β€” Activate the contextual help.
  • 1, 2, and 3 β€” Change zoom to to 100%, 200% and 300%. (yes the original says "to to", we don't gatekeep)
  • Up, Down, Left, Right β€” Scroll the image in the given direction.
  • Home β€” Display top left corner of the image.
  • End β€” Display bottom right corner of the image.
  • Control+Home β€” Go to the beginning of the document.
  • Control+End β€” Go to the end of the document.
  • Space, Return β€” Scroll down or go to next page.
  • Backspace β€” Scroll up or go to previous page.
  • Page Down β€” Go to the next page.
  • Page Up β€” Go to the previous page.
  • +, - β€” Zoom in and out.
  • [, ] β€” Rotate image.
  • W β€” Select the "Fit Width" zooming mode.
  • P β€” Select the "Fit Page" zooming mode.
  • CTRL+F, F3 β€” Search the hidden text layer.
  • CTRL+G β€” Go to a specific page by name or by number.

Now the fun part πŸ’… β€” you can get some handy effects by holding down modifier keys. These keys are configurable from the preference dialog, but here's what the default assignments look like:

  • CTRL+SHIFT β€” Hold these keys to show the magnification lens. πŸ”
  • CTRL β€” Hold this key to select an area with the mouse.
  • SHIFT β€” Hold this key to display all hyperlinks.

Like… the way that CTRL+SHIFT gives you a whole magnifying lens?? Obsessed fr fr. πŸ¦‹


🌸 ENVIRONMENT 🌸

Setting the environment variable DJVIEW_VERBOSE to a nonzero value is equivalent to calling djview with the option -verbose. And setting the environment variable DJVIEW_OPENGL to the values 0 or 1 overrides the preference settings regarding OpenGL rendering. Lowkey a whole vibe switch.

When you click on a djvu hyperlink that points to a web page, the program first tries to execute the web browser programs whose names are listed in the colon separated environment variable BROWSER. If that doesn't work out, it goes for sensible platform dependent defaults. It's giving "I'll find a way, bestie." 🌈

The user interface language is determined like this, in order:

  1. First it tries to find a complete set of translation files for the language specified in the preference dialog.
  2. Then it checks the ISO 639 languages specified in the colon separated environment variable LANGUAGE.
  3. Finally, it looks at the language specified by the system locale.
And if all of those searches fail? The user interface language reverts to the english default. No cap.

πŸ‘‘ CREDITS πŸ‘‘

This program was written by LΓ©on Bottou <leonb@users.sf.net> and is distributed under the GNU General Public License. πŸ’–

It also includes code derived from the program tiff2pdf, written by Ross Finlayson and released under a BSD license. Credit where credit is due, always. 🫢


πŸ”₯ SEE ALSO πŸ”₯


okay that's the whole page bestie, you're officially a djview4 expert now πŸ’…βœ¨

This gorgeous thing came out of DjVuLibre, dated 10/11/2001, and it's page DJVIEW4(1). go forth and render some djvu files, you absolute icon πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from